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

Xuefu Zhang commented on HIVE-15324:
------------------------------------

It's at lease unclear to me if such a change makes sense. UDF round() is to 
adjust decimal point and it should have a definitive return type. If the given 
scale is variable, we don't even know the return type. For example, 
round(decimal(10, 4), x) gives return type as decimal (8, 2) when x=2, 
decimal(9, 3) when x = 1. If each row produces a different type, then what's 
the result type?

> Enable round() function to accept scale argument as non-constants
> -----------------------------------------------------------------
>
>                 Key: HIVE-15324
>                 URL: https://issues.apache.org/jira/browse/HIVE-15324
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>            Reporter: Chinna Rao Lalam
>            Assignee: Chinna Rao Lalam
>         Attachments: HIVE-15324.1.patch, HIVE-15324.2.patch, HIVE-15324.patch
>
>
> round() function should accept  scale argument as non-constants, it will 
> enable queries like: 
> {quote}
> create table sampletable(c double, d int);
> select round(c,d) from sampletable;
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to