Michael Smith has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/23723 )

Change subject: IMPALA-13712: Calcite Planner - Enable constant folding
......................................................................


Patch Set 6:

(7 comments)

http://gerrit.cloudera.org:8080/#/c/23723/5//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/23723/5//COMMIT_MSG@24
PS5, Line 24: because folding this creates an inexact number, and this is
nit: fix inconsistent formatting between this and the next bullet point.


http://gerrit.cloudera.org:8080/#/c/23723/5/java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/RexCallConverter.java
File 
java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/RexCallConverter.java:

http://gerrit.cloudera.org:8080/#/c/23723/5/java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/RexCallConverter.java@208
PS5, Line 208:       Type decimalType = 
ImpalaTypeConverter.createImpalaType(literal.getType());
Why is this return value ignored? If this is just executed for the side-effect, 
it'd be clearer not to capture the return value.


http://gerrit.cloudera.org:8080/#/c/23723/5/java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/util/ExprConjunctsConverter.java
File 
java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/util/ExprConjunctsConverter.java:

http://gerrit.cloudera.org:8080/#/c/23723/5/java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/util/ExprConjunctsConverter.java@76
PS5, Line 76:       List<RexNode> operands = splitAndConjuncts
Is this just an optimization to avoid needing to walk the whole tree?


http://gerrit.cloudera.org:8080/#/c/23723/5/java/calcite-planner/src/main/java/org/apache/impala/calcite/rules/ImpalaFilterSimplifyRule.java
File 
java/calcite-planner/src/main/java/org/apache/impala/calcite/rules/ImpalaFilterSimplifyRule.java:

http://gerrit.cloudera.org:8080/#/c/23723/5/java/calcite-planner/src/main/java/org/apache/impala/calcite/rules/ImpalaFilterSimplifyRule.java@58
PS5, Line 58:     newCondition = reducedExprs.get(0);
A precondition that there's only one result would be nice.


http://gerrit.cloudera.org:8080/#/c/23723/5/java/calcite-planner/src/main/java/org/apache/impala/calcite/rules/RemoveUnraggedCharCastRexExecutor.java
File 
java/calcite-planner/src/main/java/org/apache/impala/calcite/rules/RemoveUnraggedCharCastRexExecutor.java:

http://gerrit.cloudera.org:8080/#/c/23723/5/java/calcite-planner/src/main/java/org/apache/impala/calcite/rules/RemoveUnraggedCharCastRexExecutor.java@78
PS5, Line 78:     
reducedValues.add(((RexCall)constExps.get(0)).getOperands().get(0));
nit: repeating all the unwrapping that rexNodeIsCharCastOfChar seems odd to me. 
Maybe this would be more straight-forward as a couple nested ifs?

This formulation does also work, and is at least clear in its intention.


http://gerrit.cloudera.org:8080/#/c/23723/6/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q03.test
File 
testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q03.test:

http://gerrit.cloudera.org:8080/#/c/23723/6/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q03.test@97
PS6, Line 97:    extrapolated-rows=disabled max-scan-range-rows=12.24M
Any idea why this changed?


http://gerrit.cloudera.org:8080/#/c/23723/6/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q57.test
File 
testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q57.test:

http://gerrit.cloudera.org:8080/#/c/23723/6/testdata/workloads/functional-planner/queries/PlannerTest/calcite_tpcds/tpcds-q57.test@52
PS6, Line 52: Per-Host Resource Estimates: Memory=7.31GB
This is a substantial change, what happened?



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I98c21ef75b2f5f8e3390ff5de5fdf45d9645b326
Gerrit-Change-Number: 23723
Gerrit-PatchSet: 6
Gerrit-Owner: Steve Carlin <[email protected]>
Gerrit-Reviewer: Aman Sinha <[email protected]>
Gerrit-Reviewer: Fang-Yu Rao <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Pranav Lodha <[email protected]>
Gerrit-Reviewer: Riza Suminto <[email protected]>
Gerrit-Comment-Date: Tue, 27 Jan 2026 18:23:07 +0000
Gerrit-HasComments: Yes

Reply via email to