hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yue Guan <pipeha...@gmail.com>
Subject aggregation avg gets different result on double and int
Date Mon, 11 Jun 2012 17:50:53 GMT
Hi, all

I have avg() problem on double and int. First, I run hive-0.7.0 on 
hadoop-0.20.2

And I run avg(cast(var as int)) and avg(cast(var as double)), which give 
different answer. The var is a integer stored as string. I also try 
avg(var) directly which gives the same result as avg(cast(var as 
double)). This is expected as Hive kind of treating double and string 
equally.

Does anyone have this kind of problem before? And any explanation? Bug 
fixed in latest version? Thank you in advance.

Best,



Mime
View raw message