Hi Shiree,

You might also try 'WHERE round(A, 1) = 3.5' as your filter.

Matt Tucker

From: shireesha chandra [mailto:[email protected]]
Sent: Thursday, March 15, 2012 2:06 AM
To: [email protected]
Subject: Float equality comparison in Hive:

Hi,

I am new to Hive. Just wanted a small clarification on the Float equality 
comparison.
For instance, to check if A is equal to 3.5, is the usage of "A>3.49 and 
A<3.51" in the WHERE clause of SELECT statement correct. Or do I have to use 
the following:
"(NOT (A<3.5) AND NOT(A>3.5))"
What is the standard procedure for float comparison?

Any pointers is greatly appreciated.

Thanks,
-Shiree

Reply via email to