hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashutosh Chauhan (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HIVE-4523) round() function with specified decimal places not consistent with mysql
Date Thu, 29 May 2014 04:14:03 GMT

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

Ashutosh Chauhan edited comment on HIVE-4523 at 5/29/14 4:13 AM:
-----------------------------------------------------------------

FWIW, this patch has broken following query which used to work before this patch:
{code}
hive>create table t1 (val double, digit int);
hive> select round(val, digit) from t1;
FAILED: SemanticException [Error 10014]: Line 1:7 Wrong arguments 'digit': ROUND second argument
only takes constant
{code}

cc: [~xuefuz] , [~brocknoland]


was (Author: ashutoshc):
FWIW, this patch has broken following query which used to work before this patch:
{code}
hive>create table t1 (val double, digit int);
hive> select round(val, digit) from round_test;
FAILED: SemanticException [Error 10014]: Line 1:7 Wrong arguments 'digit': ROUND second argument
only takes constant
{code}

cc: [~xuefuz] , [~brocknoland]

> 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
>             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.2#6252)

Mime
View raw message