You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Yue Guan <pi...@gmail.com> on 2012/06/11 19:50:53 UTC

aggregation avg gets different result on double and int

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,