You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@impala.apache.org by "Alex Behm (Code Review)" <ge...@cloudera.org> on 2016/05/19 15:37:36 UTC

[Impala-CR](cdh5-2.6.0_5.8.0) IMPALA-3439: Only convert decimal literals in convertNumericLiteralsFromDecimal().

Alex Behm has uploaded a new change for review.

  http://gerrit.cloudera.org:8080/3138

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
---
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(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala refs/changes/38/3138/1
-- 
To view, visit http://gerrit.cloudera.org:8080/3138
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I33f319b00a8fef3a81418d6c7ac030b002c5d0d1
Gerrit-PatchSet: 1
Gerrit-Project: Impala
Gerrit-Branch: cdh5-2.6.0_5.8.0
Gerrit-Owner: Alex Behm <al...@cloudera.com>