hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xuefu Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-6459) Change the precison/scale for intermediate sum result in the avg() udf
Date Sun, 02 Mar 2014 02:11:19 GMT

     [ https://issues.apache.org/jira/browse/HIVE-6459?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Xuefu Zhang updated HIVE-6459:
------------------------------

       Resolution: Fixed
    Fix Version/s: 0.13.0
           Status: Resolved  (was: Patch Available)

Patch committed to trunk. Thanks Prasad for the review.

> Change the precison/scale for intermediate sum result in the avg() udf 
> -----------------------------------------------------------------------
>
>                 Key: HIVE-6459
>                 URL: https://issues.apache.org/jira/browse/HIVE-6459
>             Project: Hive
>          Issue Type: Improvement
>          Components: UDF
>    Affects Versions: 0.13.0
>            Reporter: Xuefu Zhang
>            Assignee: Xuefu Zhang
>             Fix For: 0.13.0
>
>         Attachments: HIVE-6459.1.patch, HIVE-6459.2.patch, HIVE-6459.3.patch, HIVE-6459.4.patch,
HIVE-6459.patch
>
>
> The avg() udf, when applied to a decimal column, selects the precision/scale of the intermediate
sum field as (p+4, s+4), which is the same for the precision/scale of the avg() result. However,
the additional scale increase is unnecessary, and the problem of data overflow may occur.
The requested change is that for the intermediate sum result,  the precsion/scale is set to
(p+10, s), which is consistent to sum() udf. The avg() result still keeps its precision/scale.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message