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


Change subject: PROTOTYPE IMPALA-15521: Skip exchange on identically 
partitioned input
......................................................................

PROTOTYPE IMPALA-15521: Skip exchange on identically partitioned input

In TPC-DS q78, a partitioned right outer join gets a hash exchange on
an input that is already hash-partitioned on exactly the exprs the
exchange uses. isCompatPartition() rejects the join because the join
conjuncts are in a different order than the partition exprs, and an
outer join has no value transfer in both directions.

Two relaxations:
- No hash exchange is added on top of a join input whose data
  partition is identical to the one the exchange would produce (same
  exprs, order and types). The input is merged into the join's
  fragment instead. This alone removes the exchange in q78.
- isCompatPartition() also accepts permutations: each partition
  position must match one equi-join conjunct on both sides, with
  identical types. Not applied to joins that return unmatched build
  rows (RIGHT OUTER, FULL OUTER, RIGHT ANTI).
Both rules require partition exprs that only reference tuples that are
materialized and not nullable at the input's root.

Testing:
- TPC-DS SF100, 5 executors, MT_DOP=0: q78 28 s -> 12 s, total -6.3%.
  Results matched master, except q56 and q65, whose LIMIT ties vary
  between runs. Planner test expectations are not updated.

Change-Id: Ifd9a15d0ff95db30882c037f6198374389795560
Assisted-by: Claude Opus 5.5 (Claude Code)
---
M fe/src/main/java/org/apache/impala/planner/DistributedPlanner.java
1 file changed, 164 insertions(+), 4 deletions(-)



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

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

Reply via email to