Zoltan Borok-Nagy has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/25071


Change subject: PROTOTYPE IMPALA-15523: Run Calcite HepPlanner programs in DAG 
mode
......................................................................

PROTOTYPE IMPALA-15523: Run Calcite HepPlanner programs in DAG mode

CalciteOptimizer ran every HepPlanner program with noDag=true. When a
WITH clause is inlined many times, every identical copy is optimized
separately, and HepPlanner restarts its traversal after each rule
firing. TPC-DS q14_1 inlines cross_items 15 times and plans for 13 s.

The node optimization programs (before and after join ordering) and
the join ordering program now run with noDag=false, so identical
subtrees become one vertex and are optimized once. Before the CTE
rewrite and the conversion to Impala nodes, unshare() turns the
result back into a tree by copying every RelNode reached a second
time, with its subtree, including LogicalTableScan and LogicalValues
leaves. Tuple descriptors and plan nodes are then never aliased.

Testing:
- Impala plans were byte-identical for the 104 TPC-DS queries.
- Calcite planner tests pass, except 5 conjunct-order differences in
  the Calcite-level EXPLAIN section (expectations not updated).
- Together with IMPALA-15524, TPC-DS SF100 at MT_DOP=8 and
  CTE_THRESHOLD=1: q14_1 22.3 s -> 7.0 s, total 147.0 s -> 128.4 s.

Change-Id: Iafe4a5ece9de367947823b99122721a1f0be26fe
Assisted-by: Claude Opus 5.5 (Claude Code)
---
M 
java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteOptimizer.java
1 file changed, 65 insertions(+), 3 deletions(-)



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iafe4a5ece9de367947823b99122721a1f0be26fe
Gerrit-Change-Number: 25071
Gerrit-PatchSet: 1
Gerrit-Owner: Zoltan Borok-Nagy <[email protected]>

Reply via email to