Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive, mail # user - Round function display


Copy link to this message
-
Round function display
chenchun 2013-03-14, 07:44
Hi,
I have a question about HIVE-3675 NaN does not work correctly for round(n).
The issue did solve the NaN problem, but the hql below result in a different display with hive0.10.
I checked the code UDFRound.java, found the function "LongWritable evaluate(DoubleWritable n)" changed to "DoubleWritable evaluate(DoubleWritable n) ".
I think it maybe better to add a "LongWritable evaluate(LongWritable n)" function and modify the toString function of LongWritable that could solve the problem.
select round(1234560), round(12345670) from test limit 1;

//hive 0.10
1234560.0  1.234567E7

//hive 0.9
1234560     12345670

select round(cast(1234560 as BIGINT)), round(cast(12345670 as BIGINT)) from test limit 1;

//hive 0.10
1234560.0  1.234567E7
regards,
chenchun