Hacky, but maybe something like

select concat( cast(num as int), '.' , cast(abs(num)*100 as int) % 100) from 
(select 1.234 as num from src limit 1) a;

?

-----Original Message-----
From: Aurora Skarra-Gallagher [mailto:aur...@yahoo-inc.com] 
Sent: Thursday, February 24, 2011 11:31 AM
To: user@hive.apache.org
Subject: Specifying a double precision in HiveQL

Hi,

I have a Hive query that has a statement like this "(sum(itemcount) / 
count(item))". I want to specify only two digits of precision (i.e. 53.55). The 
result is stored inside of a string, not its own column, so I'd need to set the 
precision in the statement. Is this possible?

Thanks,
Aurora

Reply via email to