Internal Jenkins has submitted this change and it was merged.

Change subject: IMPALA-3439: Only convert decimal literals in 
convertNumericLiteralsFromDecimal().
......................................................................


IMPALA-3439: Only convert decimal literals in 
convertNumericLiteralsFromDecimal().

Numeric literals with a decimal point are typed as DECIMAL, if possible. Since
decimals have a higher processing cost than FLOAT/DOUBLE we have special casting
rules to convert DECIMAL operations to DOUBLE in certain reasonable 
circumstances.

The bug was that in this conversion process we used to blindly replace all 
numeric
literals with DOUBLE. The blind conversion caused expressions to fail analysis
after the substitution if they did not have a matching DOUBLE signature.
For example, round() requies the second argument to be an integer, and does
not have a signature with DOUBLE as the second argument.

The fix is to only replace DECIMAL literals with DOUBLE.

Based on the comments in the relevant parts of the code, this new behavior 
matches
the original intent more cleanly/directly.

Testing: I did a private core/hdfs run and local testing.

Change-Id: I33f319b00a8fef3a81418d6c7ac030b002c5d0d1
Reviewed-on: http://gerrit.cloudera.org:8080/3138
Reviewed-by: Alex Behm <[email protected]>
Tested-by: Internal Jenkins
---
M fe/src/main/java/com/cloudera/impala/analysis/Expr.java
M fe/src/test/java/com/cloudera/impala/analysis/AnalyzeExprsTest.java
2 files changed, 10 insertions(+), 6 deletions(-)

Approvals:
  Internal Jenkins: Verified
  Alex Behm: Looks good to me, approved



-- 
To view, visit http://gerrit.cloudera.org:8080/3138
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I33f319b00a8fef3a81418d6c7ac030b002c5d0d1
Gerrit-PatchSet: 3
Gerrit-Project: Impala
Gerrit-Branch: cdh5-2.6.0_5.8.0
Gerrit-Owner: Alex Behm <[email protected]>
Gerrit-Reviewer: Alex Behm <[email protected]>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Tim Armstrong <[email protected]>

Reply via email to