You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Zhichun Wu (JIRA)" <ji...@apache.org> on 2014/10/10 09:56:34 UTC

[jira] [Commented] (HIVE-4523) round() function with specified decimal places not consistent with mysql

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

Zhichun Wu commented on HIVE-4523:
----------------------------------

@ [~xuefuz] , after upgrading our hive from hive 0.11 to hive 0.13, we find that udf round's behavior is not consistent with float value. in hive 0.11, when we round one float it returns one DoubleWritable in UDFRound.While in hive 0.13, it return one FloatWritable in GenericUDFRound. Currently we would like to fix this in hive 13 to let it be consistent with hive 11.

Any suggestion?

> round() function with specified decimal places not consistent with mysql 
> -------------------------------------------------------------------------
>
>                 Key: HIVE-4523
>                 URL: https://issues.apache.org/jira/browse/HIVE-4523
>             Project: Hive
>          Issue Type: Improvement
>          Components: UDF
>    Affects Versions: 0.7.1
>            Reporter: Fred Desing
>            Assignee: Xuefu Zhang
>            Priority: Minor
>              Labels: TODOC13
>             Fix For: 0.13.0
>
>         Attachments: HIVE-4523.1.patch, HIVE-4523.2.patch, HIVE-4523.3.patch, HIVE-4523.4.patch, HIVE-4523.5.patch, HIVE-4523.6.patch, HIVE-4523.7.patch, HIVE-4523.8.patch, HIVE-4523.patch
>
>
> // hive
> hive> select round(150.000, 2) from temp limit 1;
> 150.0
> hive> select round(150, 2) from temp limit 1;
> 150.0
> // mysql
> mysql> select round(150.000, 2) from DUAL limit 1;
> round(150.000, 2)
> 150.00
> mysql> select round(150, 2) from DUAL limit 1;
> round(150, 2)
> 150
> http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html#function_round



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