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

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

With this latest patch, I see all the failed tests passing. I have just started 
a run of the entire test suite just to be sure I did not break anything. There 
is one issue however. The mysql round function behavior does not seem to be 
reproducible via the bigdecimal round function. The round function takes a math 
context object whose scale can only be a positive integer and this results in 
some inconsistent results. The currently existing double-based method is 
producing the expected results in accordance with the mysql response. I am not 
sure which way the coin should drop in this case. Bigdecimal's primary use case 
is to have higher precision but, the round operation is not entirely compatible 
with the current mysql standard. As an err on the mysql side strategy, I have 
taken the approach of sticking to the current double based round api. Based on 
consensus in the hive community, I can add back the capability to go the big 
decimal route or if anyone knows how to tune the bigdecimal to round the way 
mysql does it, I would be happy to correct/use that.

Apart from this change, I have also had to refactor the code in 
FunctionRegistry to be able to choose a 'higher denominator' api over a lower 
one as alluded to in the comment above. This was required for the logarithm udf 
function. I have refactored things in such a way that new apis can easily be 
added that uses the already existing hierarchy without the user having to get 
caught in these internals.
                
> 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: 2693_fix_all_tests1.patch, 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