hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abhishek Gayakwad <a.gayak...@gmail.com>
Subject HIVE 0.12 SUM() returning NULL for decimal values
Date Thu, 24 Jul 2014 15:10:55 GMT
I am trying to aggregate one column of decimal type, which is returning me
null. If I cast this column to double it returns me some value. following
are the steps to recreate this scenario.

----------------------------
CREATE  TABLE salestemp(sku int, sales decimal);

LOAD DATA LOCAL INPATH '000000_0' OVERWRITE INTO TABLE salestemp;

select sum(sales) from salestemp; // returns null

select sum(cast(sales AS double)) from salestemp; // returns
353.9609497977414

----------------------------
data in  '000000_0'  looks like
--------------------------------
24687329978.000156909543021743116491818900326715
246873303113.06617408356827568833561026591436615
246873314156.00031381908604348623298363780065343
2468733246.8943049855440756796081014881223248771
2468733280
--------------------------------

Please let me know what is going wrong here.

Thanks
Abhishek

Mime
View raw message