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

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

@ [~xuefuz],  I dont mean to change this behavior for next realease, just for 
our maintenance branch. Returning float is enough, but it's not consistent with 
previous version of hive (0.11). Some of our hive queries happen to use this 
assumption while doing some aggregation (with the form of sum(round(some_float, 
2)) ). These queries would suffer from precision limit of float when the sum 
are huge. Here we just plan to preserve this behavior to fix these queries 
temporarily and give a feedback to see whether this is intended.

> 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)

Reply via email to