[ 
https://issues.apache.org/jira/browse/HIVE-5872?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13845715#comment-13845715
 ] 

Xuefu Zhang commented on HIVE-5872:
-----------------------------------

Thanks for the review, Prasad.

{quote}
In general, it looks like we need more exception logic for handling decimals in 
UDAF (HIVE-5872, HIVE-5866). It might be useful to add a note in the dev guide 
for future work ..
{quote}
I assume you are referring the following code snippet:
{code}
        if (t == null) {
          return warnedOnceNullMapKey;
        }
{code}
I agree with your assessment. Currently Hive emits null as the only error 
handling option. Thus, null check is (or is missed) everywhere in the code, not 
specific to decimal. For a long run, I agree we need to have a better exception 
handling, especially when we introduce different error handling (HIVE-5438).


> Make UDAFs such as GenericUDAFSum report accurate precision/scale for decimal 
> types
> -----------------------------------------------------------------------------------
>
>                 Key: HIVE-5872
>                 URL: https://issues.apache.org/jira/browse/HIVE-5872
>             Project: Hive
>          Issue Type: Improvement
>          Components: Types, UDF
>    Affects Versions: 0.12.0
>            Reporter: Xuefu Zhang
>            Assignee: Xuefu Zhang
>             Fix For: 0.13.0
>
>         Attachments: HIVE-5872.1.patch, HIVE-5872.2.patch, HIVE-5872.3.patch, 
> HIVE-5872.4.patch, HIVE-5872.patch
>
>
> Currently UDAFs are still reporting system default precision/scale (38, 18) 
> for decimal results. Not only this is coarse, but also this can cause 
> problems in subsequent operators such as division, where the result is 
> dependent on the precision/scale of the input, which can go out of bound 
> (38,38). Thus, these UDAFs should correctly report the precision/scale of the 
> result.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Reply via email to