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

Vikram Dixit K commented on HIVE-2693:
--------------------------------------

Hi Josh,

Can you tell me why in the UDFRound.java, the math context is being initialized 
with the formula bd.precision() - (bd.scale() - i.get())? This is causing some 
issues with respect to calls such as round(55555, -6) etc. The reason is the 
bigdecimal constructor sets precision by default to the number of digits of the 
integer passed into it. In this case for 55555, it is set to 5 and the scale by 
default is 0. This implies that for this case, the formula above results in a 
negative number that the mathcontext constructor cannot take. I am not sure 
what the behavior should be?

Thanks
Vikram.
                
> Add DECIMAL data type
> ---------------------
>
>                 Key: HIVE-2693
>                 URL: https://issues.apache.org/jira/browse/HIVE-2693
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Processor, Types
>            Reporter: Carl Steinbach
>            Assignee: Prasad Mujumdar
>         Attachments: HIVE-2693-all.patch, HIVE-2693-fix.patch, 
> HIVE-2693.patch, HIVE-2693-take3.patch, HIVE-2693-take4.patch
>
>
> Add support for the DECIMAL data type. HIVE-2272 (TIMESTAMP) provides a nice 
> template for how to do this.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to