Steve Carlin has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/22034


Change subject: IMPALA-13516: Fix handling of cast functions
......................................................................

IMPALA-13516: Fix handling of cast functions

There were some cast functions that were failing. There were
several reasons behind this.  One reason was because Calcite
classifies all integers as an "int" even if they can be other
smaller types (e.g. tinyint). Normally this is handled by the
"CoerceNodes" portion, but it is impossible to tell the type if the
query had the phrase "select cast(1 as integer)" or "select 1"
since both would show up to CoerceNodes as "select 1:INT"

In order to handle this an "explicit_cast" operator now exists and
is used when the cast function is parsed within the commit. The
explicit_cast operator has to be different from the "cast" Calcite
operator in order to avoid being optimized out in various portions
of the compilation.

Change-Id: I1edabc942de1c4030331bc29612c41b392cd8a05
---
M 
java/calcite-planner/src/main/java/org/apache/impala/calcite/coercenodes/CoerceOperandShuttle.java
M 
java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/FunctionResolver.java
M 
java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/RexCallConverter.java
M 
java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/CommonOperatorFunctions.java
A 
java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaCastFunction.java
M 
java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaConvertletTable.java
M 
java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaOperatorTable.java
7 files changed, 144 insertions(+), 1 deletion(-)



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1edabc942de1c4030331bc29612c41b392cd8a05
Gerrit-Change-Number: 22034
Gerrit-PatchSet: 1
Gerrit-Owner: Steve Carlin <[email protected]>

Reply via email to