[
https://issues.apache.org/jira/browse/HIVE-4174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Phabricator updated HIVE-4174:
------------------------------
Attachment: HIVE-4174.D9687.1.patch
chenchun requested code review of "HIVE-4174 [jira] Round UDF converts BigInts
to double".
Reviewers: JIRA
Round UDF return type be the same type as that of the first argument
Chen Chun pointed out on the hive-user mailing list that round() in Hive 0.10
returns
select round(cast(1234560 as BIGINT)), round(cast(12345670 as BIGINT)) from
test limit 1;
//hive 0.10
1234560.0 1.234567E7
This is not consistent with
MySQL(http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html#function_round)
which quotes
The return type is the same type as that of the first argument (assuming that
it is integer, double, or decimal). This means that for an integer argument,
the result is an integer (no decimal places)
TEST PLAN
EMPTY
REVISION DETAIL
https://reviews.facebook.net/D9687
AFFECTED FILES
ql/src/java/org/apache/hadoop/hive/ql/udf/UDFRound.java
ql/src/test/queries/clientpositive/udf_round_3.q
ql/src/test/results/clientpositive/udf_round.q.out
ql/src/test/results/clientpositive/udf_round_3.q.out
MANAGE HERALD RULES
https://reviews.facebook.net/herald/view/differential/
WHY DID I GET THIS EMAIL?
https://reviews.facebook.net/herald/transcript/23127/
To: JIRA, chenchun
> Round UDF converts BigInts to double
> ------------------------------------
>
> Key: HIVE-4174
> URL: https://issues.apache.org/jira/browse/HIVE-4174
> Project: Hive
> Issue Type: Bug
> Components: UDF
> Affects Versions: 0.10.0
> Reporter: Mark Grover
> Assignee: Mark Grover
> Fix For: 0.11.0
>
> Attachments: HIVE-4174.1.patch.txt, HIVE-4174.D9687.1.patch
>
>
> Chen Chun pointed out on the hive-user mailing list that round() in Hive 0.10
> returns
> {code}
> select round(cast(1234560 as BIGINT)), round(cast(12345670 as BIGINT)) from
> test limit 1;
> //hive 0.10
> 1234560.0 1.234567E7
> {code}
> This is not consistent with
> MySQL(http://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html#function_round)
> which quotes
> {code}
> The return type is the same type as that of the first argument (assuming that
> it is integer, double, or decimal). This means that for an integer argument,
> the result is an integer (no decimal places)
> {code}
--
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