Hello Aman Sinha, Joe McDonnell, Michael Smith, Impala Public Jenkins,

I'd like you to reexamine a change. Please visit

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

to look at the new patch set (#7).

Change subject: IMPALA-14814: Handle implicit casts properly for Calcite Planner
......................................................................

IMPALA-14814: Handle implicit casts properly for Calcite Planner

Previous to this commit, the Calcite planner overrode the isImplicit()
method to prevent the framework from removing implicit casts. The
reasoning behind this was because Calcite has already gone through the
analysis phase and determined that a cast was necessary.

The original planner combines the substitution of slot refs
with the removal of implicit casts and then re-analyzes the Expr object.
So Calcite needs to avoid this removal.

On first pass, it seemed that removing any recognition of the existence
of an implicit cast was an adequate solution. However, in certain cases,
like the analysis of parquet stats, the physical planner needs to know
if the cast is explicit or implicit.

This commit now sets the isImplicit_ variable correctly in the
AnalyzedCastExpr through the CastExpr constructor.

The code within substituteImpl that removes the cast has been moved into
the child CastExpr class. A new method, shouldRemoveImplicitCast(),
will return the isImplicit() value for the CastExpr class but will always
return false for the Calcite AnalyzedCastExpr class. In addition to this
change, the "hashCode()" method is also used within the ExprSubstitutionMap
so that code also needs to be avoided in the child AnalyzedCastExpr class.

Change-Id: I4d71357ac7f228404713f96884d9eff7f8eabe5c
---
M fe/src/main/java/org/apache/impala/analysis/CastExpr.java
M fe/src/main/java/org/apache/impala/analysis/Expr.java
M 
java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/AnalyzedCastExpr.java
M 
java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/RexCallConverter.java
M testdata/workloads/functional-query/queries/QueryTest/calcite.test
M testdata/workloads/functional-query/queries/QueryTest/orc-stats.test
M testdata/workloads/functional-query/queries/QueryTest/parquet-stats.test
7 files changed, 62 insertions(+), 54 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/47/24247/7
--
To view, visit http://gerrit.cloudera.org:8080/24247
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4d71357ac7f228404713f96884d9eff7f8eabe5c
Gerrit-Change-Number: 24247
Gerrit-PatchSet: 7
Gerrit-Owner: Steve Carlin <[email protected]>
Gerrit-Reviewer: Aman Sinha <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>

Reply via email to