Taras Bobrovytsky has uploaded a new patch set (#4). ( http://gerrit.cloudera.org:8080/8398 )
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 translateion 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 translation invisible, we also rename it back to round() in toSql(). This translation should be removed when we remove decimal v1. Testing: - Added EE tests. Change-Id: I240ec70da7996bbfefcf6438eba4dff8d33d7bd6 --- M be/src/exprs/decimal-functions-ir.cc M be/src/exprs/decimal-functions.h M be/src/exprs/decimal-operators.h M common/function-registry/impala_functions.py M fe/src/main/cup/sql-parser.cup M fe/src/main/java/org/apache/impala/analysis/AnalysisContext.java M fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java M fe/src/main/java/org/apache/impala/analysis/FunctionName.java M fe/src/test/java/org/apache/impala/analysis/AnalyzeExprsTest.java M testdata/workloads/functional-query/queries/QueryTest/decimal-exprs.test 10 files changed, 268 insertions(+), 18 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/98/8398/4 -- To view, visit http://gerrit.cloudera.org:8080/8398 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I240ec70da7996bbfefcf6438eba4dff8d33d7bd6 Gerrit-Change-Number: 8398 Gerrit-PatchSet: 4 Gerrit-Owner: Taras Bobrovytsky <tbobrovyt...@cloudera.com> Gerrit-Reviewer: Alex Behm <alex.b...@cloudera.com> Gerrit-Reviewer: Taras Bobrovytsky <tbobrovyt...@cloudera.com> Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com>