Aleksandr Efimov has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/24426 )

Change subject: IMPALA-14601: Support HBO for JoinNode cardinality
......................................................................


Patch Set 24:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/24426/24/fe/src/main/java/org/apache/impala/planner/ExprCanonicalizer.java
File fe/src/main/java/org/apache/impala/planner/ExprCanonicalizer.java:

http://gerrit.cloudera.org:8080/#/c/24426/24/fe/src/main/java/org/apache/impala/planner/ExprCanonicalizer.java@191
PS24, Line 191:     if (sourceExprs.size() != 1 || !(sourceExprs.get(0) 
instanceof SlotRef)) return null;
> Nice catch! I'm able to reproduce the issue using an Aggregation over Join:
Covers the sort case I started from too: for a non-SlotRef expr, 
SortInfo.addMaterializedExprs() takes the else branch - a fresh slot in the 
sort tuple, so no path and isScanSlot() false - and sets exactly one source 
expr (SortInfo.java:266). An ORDER BY coalesce(a.id, b.int_col) therefore hits 
the same branch as the aggregation. Read, not run.

resolveOperandIndex() keeps a visited set against cycles in the source-expr 
chain, and qualifyForHbo() walks the same chain without one. On a cycle the 
guard returns null and the descent into srcExprs.get(0) recurses until the 
stack runs out. Is a cycle ruled out on this path, or would the same guard fit 
here?

testMultiTableFuncExpr pins the aggregation. Would a swapped ORDER BY 
coalesce(...) case for SortNode, and the analytic one, be worth adding? That is 
the path the collision came from.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I70b655ae7027d0d9eb8e9fae9ba2e1b7ad9876b4
Gerrit-Change-Number: 24426
Gerrit-PatchSet: 24
Gerrit-Owner: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Aleksandr Efimov <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Steve Carlin <[email protected]>
Gerrit-Comment-Date: Wed, 02 Sep 2026 09:47:01 +0000
Gerrit-HasComments: Yes

Reply via email to