Re: A question about the derivation of intermediate sum field for decimal average aggregates

2014-02-15 Thread Xuefu Zhang
ic Hanson (BIG DATA) > Subject: Re: A question about the derivation of intermediate sum field for > decimal average aggregates > > Hi Remus, > > Thank you for the info. I now realized that it might be good to address > this, as the object inspector for the sum field might be problematic

RE: A question about the derivation of intermediate sum field for decimal average aggregates

2014-02-15 Thread Remus Rusanu
:45 AM To: dev@hive.apache.org Cc: Eric Hanson (BIG DATA) Subject: Re: A question about the derivation of intermediate sum field for decimal average aggregates Hi Remus, Thank you for the info. I now realized that it might be good to address this, as the object inspector for the sum field might be

Re: A question about the derivation of intermediate sum field for decimal average aggregates

2014-02-14 Thread Xuefu Zhang
gt; Sent: Friday, February 14, 2014 7:18 PM > To: dev@hive.apache.org > Cc: xu...@apache.org; Eric Hanson (BIG DATA) > Subject: Re: A question about the derivation of intermediate sum field for > decimal average aggregates > > Remus, > > Thanks for looking into this. You're ri

RE: A question about the derivation of intermediate sum field for decimal average aggregates

2014-02-14 Thread Remus Rusanu
Zhang [mailto:xzh...@cloudera.com] Sent: Friday, February 14, 2014 7:18 PM To: dev@hive.apache.org Cc: xu...@apache.org; Eric Hanson (BIG DATA) Subject: Re: A question about the derivation of intermediate sum field for decimal average aggregates Remus, Thanks for looking into this. You're righ

Re: A question about the derivation of intermediate sum field for decimal average aggregates

2014-02-14 Thread Xuefu Zhang
Remus, Thanks for looking into this. You're right that sum() result doesn't increase the scale, but have you seen that sum UDF returns wrong scale? As to the implementation of avg UDF, the object inspector for sum field is initialized with a scale + 4, which might not be necessary, but perhaps ha

A question about the derivation of intermediate sum field for decimal average aggregates

2014-02-14 Thread Remus Rusanu
Hi, With HIVE-5872 the intermediate sum field for decimal aggregates was changed to increase scale by 4. I understand the reasoning for having accurate precision/scale for the aggregate output. However, for the intermediate sum field of AVG, I believe we should increase precision w/o increasing