[
https://issues.apache.org/jira/browse/IMPALA-6230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Taras Bobrovytsky resolved IMPALA-6230.
---------------------------------------
Resolution: Fixed
Fix Version/s: Impala 3.0
{noformat}
commit 8fec1911e52e40aff4cc1de17265bd6803cb13f5
Author: Taras Bobrovytsky <[email protected]>
Date: Tue Jan 30 18:21:14 2018 -0800
IMPALA-6230, IMPALA-6468: Fix the output type of round() and related fns
Before this patch, the output type of round() ceil() floor() trunc() was
not always the same as the input type. It was also inconsistent in
general. For example, round(double) returned an integer, but
round(double, int) returned a double.
After looking at other database systems, we decided that the guideline
should be that the output type should be the same as the input type. In
this patch, we change the behavior of the previously mentioned functions
so that if a double is given then a double is returned.
We also modify the rounding behavior to always round away from zero.
Before, we were rounding towards positive infinity in some cases.
Testinging:
- Updated tests
- Ran an exhaustive build which passed.
Cherry-picks: not for 2.x
Change-Id: I77541678012edab70b182378b11ca8753be53f97
Reviewed-on: http://gerrit.cloudera.org:8080/9346
Reviewed-by: Alex Behm <[email protected]>
Tested-by: Impala Public Jenkins{noformat}
> The output type of a round() function should match the input type
> -----------------------------------------------------------------
>
> Key: IMPALA-6230
> URL: https://issues.apache.org/jira/browse/IMPALA-6230
> Project: IMPALA
> Issue Type: Bug
> Components: Backend, Frontend
> Affects Versions: Impala 2.10.0
> Reporter: Taras Bobrovytsky
> Assignee: Taras Bobrovytsky
> Priority: Major
> Labels: incompatibility
> Fix For: Impala 3.0
>
>
> At the next compatibility breaking version we should revisit the output types
> of round() functions. In order to match the behavior of most of other
> database systems, the output type of the round() functions should be the same
> as the input type.
> For example, today, round(double) returns a bigint. We should return a double
> instead.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)