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

Change subject: IMPALA-15175: Support HBO for AnalyticEvalNode cardinality
......................................................................


Patch Set 6:

(1 comment)

PS6 read. Moving the operand qualifiers into 
PlanNode.buildHboOperandQualifierMap() reads right for the analytic case: with 
no join above, the empty prefix keeps the map empty and the key stays 
unqualified; under a join, the analytic output tuple gets the operand's own 
path.

One new comment, on the test. The limit_ and NULLS FIRST/LAST threads from PS4 
are still open - no rush, you said they are coming in the next patch set.

http://gerrit.cloudera.org:8080/#/c/24608/6/fe/src/test/java/org/apache/impala/planner/HboKeyStringTest.java
File fe/src/test/java/org/apache/impala/planner/HboKeyStringTest.java:

http://gerrit.cloudera.org:8080/#/c/24608/6/fe/src/test/java/org/apache/impala/planner/HboKeyStringTest.java@1343
PS6, Line 1343:         + "op.rank() OVER (PARTITION BY a.int_col ORDER BY b.id 
ASC),"
These `a.` and `b.` are the query's aliases, and they land inside the HBO key. 
AnalyticExpr.toSqlImpl() returns sqlString_ first thing - frozen at 
analyzeImpl:538, before standardize() - and never looks at the options, so 
ToSqlOptions.FOR_HBO does not reach it. SlotRef.toSqlImpl() goes the other way 
for exactly this reason: it resolves a non-scan slot through its source expr to 
stay "independent of the alias written in the query".

Both forms sit in this one expected key: line 1336 renders the analytic as 
PART:[op0.int_col], line 1343 as PARTITION BY a.int_col. The window is missing 
from the second one too, though the canonical key carries WINDOW:RANGE BETWEEN 
UNBOUNDED PRECEDING AND CURRENT ROW - which is the pre-standardize() string 
showing through.

So the same query written with different aliases hashes differently, and a 
query written lead(x) hashes differently from one written lead(x, 1, null), 
though standardization makes them the same expression. The analytic node's own 
key is unaffected - this only reaches nodes above it. Bypassing sqlString_ in 
toSqlImpl() when options.showForHbo() would cover both. Fix here, or separate 
JIRA?



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8d87ab472db9273622f48fa62bb1d8c12e04e86b
Gerrit-Change-Number: 24608
Gerrit-PatchSet: 6
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: Tue, 01 Sep 2026 08:19:30 +0000
Gerrit-HasComments: Yes

Reply via email to