Hello Quanlong Huang, Aman Sinha, Jason Fehr, Aleksandr Efimov, Joe McDonnell,
Michael Smith, Impala Public Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/24217
to look at the new patch set (#8).
Change subject: IMPALA-14911: Calcite planner: Fix boolean to numeric comparison
......................................................................
IMPALA-14911: Calcite planner: Fix boolean to numeric comparison
This commit fixes the following failure in the Calcite planner:
select count(*) from functional.alltypestiny
where smallint_col > sleep(100);
The coercion method for binary comparison is overridden to return
the common type as the numeric so that the internals of Calcite
create the cast around the boolean operand. Calcite only applied
the cast to "equals" binary comparisons. For Decimal, the common
type is FLOAT.
The booleanEquality method was also overridden because Calcite
does coercion in there as well. it will always return false so
that all binary comparison coercions are done in the overridden
commonTypeForBinaryComparison method.
The RexBuilder makeCast method had to be overridden because the
default Calcite handles boolean casting with a case statement
whereas Impala can handle casts the boolean directly to a
numeric type.
Change-Id: I764dcbd2fd0d1323bfb964ed91d94cd3def594c0
Testing: added e2e test
---
M
java/calcite-planner/src/main/java/org/apache/impala/calcite/operators/ImpalaRexBuilder.java
M
java/calcite-planner/src/main/java/org/apache/impala/calcite/type/ImpalaTypeCoercionImpl.java
A
testdata/workloads/functional-query/queries/QueryTest/binary_exprs_with_boolean.test
M testdata/workloads/functional-query/queries/QueryTest/calcite.test
M tests/query_test/test_exprs.py
5 files changed, 408 insertions(+), 0 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/17/24217/8
--
To view, visit http://gerrit.cloudera.org:8080/24217
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I764dcbd2fd0d1323bfb964ed91d94cd3def594c0
Gerrit-Change-Number: 24217
Gerrit-PatchSet: 8
Gerrit-Owner: Steve Carlin <[email protected]>
Gerrit-Reviewer: Aleksandr Efimov <[email protected]>
Gerrit-Reviewer: Aman Sinha <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Jason Fehr <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Steve Carlin <[email protected]>