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

Switch to Threaded View
Hive >> mail # dev >> A question about the derivation of intermediate sum field for decimal average aggregates


Copy link to this message
-
Re: A question about the derivation of intermediate sum field for decimal average aggregates
10 was chosen in Hive. While rather arbitrary, it seems reasonable. The
problem of going all the way to max is lack of room to grow decimal parts
for subsequent operations. For instance, if we have sum(a) of (38, 2), then
the expression, sum(a)/count(*) can only have a precision/scale (38,2),
which may not be an accurate average.

I'm not sure how other DB does, but MySQL doesn't go all the way to max.
And there is no standard on this.

On Sat, Feb 15, 2014 at 12:55 AM, Remus Rusanu <[EMAIL PROTECTED]> wrote: