impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Taras Bobrovytsky (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-3436: Return a decimal when rounding a double
Date Thu, 26 Oct 2017 03:02:05 GMT
Taras Bobrovytsky has uploaded this change for review. (

Change subject: IMPALA-3436: Return a decimal when rounding a double

IMPALA-3436: Return a decimal when rounding a double

Before this patch, the function round(double, int) returned a double,
which is inconsistent with other round() functions.

In this patch, we change the return type of round(double, int) to be
decimal only if decimal_v2 is enabled. If decimal_v2 is not enabled,
the function returns a double, as before.

This is implemented by introducing a "hack" where we make the parser
aware of query options and rename the function to round_v1() during
parsing if decimal_v2 is not enabled. To make this hack invisible, we
also rename it back to round() in toSql().

This hack should be removed when we remove decimal v1.

- Added EE tests.

Change-Id: I240ec70da7996bbfefcf6438eba4dff8d33d7bd6
M be/src/exprs/
M be/src/exprs/decimal-functions.h
M be/src/exprs/decimal-operators.h
M common/function-registry/
M fe/src/main/cup/sql-parser.cup
M fe/src/main/java/org/apache/impala/analysis/
M fe/src/main/java/org/apache/impala/analysis/
M testdata/workloads/functional-query/queries/QueryTest/decimal-exprs.test
8 files changed, 227 insertions(+), 13 deletions(-)

  git pull ssh:// refs/changes/98/8398/1
To view, visit
To unsubscribe, visit

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I240ec70da7996bbfefcf6438eba4dff8d33d7bd6
Gerrit-Change-Number: 8398
Gerrit-PatchSet: 1
Gerrit-Owner: Taras Bobrovytsky <>

  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message