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

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


Patch Set 13:

(1 comment)

Changed the patch to not storing/reading cardinality of AnalyticEvalNode since 
it's cardinality can be trivially deduced by the input cardinality. 
AnalyticEvalNode is still used in the HBO key string for other node types.

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

http://gerrit.cloudera.org:8080/#/c/24608/6/fe/src/main/java/org/apache/impala/planner/AnalyticEvalNode.java@383
PS6, Line 383:     StringBuilder output = new StringBuilder();
> Will this work for empty partition-by ? for instance rank() over (order by 
> c1)  (this is useful for global ranking).

Yeah, empty partition-by will have "PartExprs:[]" in the HBO key string. Note 
that patch set 7 renames "PART" to "PartExprs".

> Also, thinking about partition-by, have you considered using the HBO stats 
> even if there's a partial match?

That's a good question. Cardinality of AnalyticEvalNode can be simply deduced 
from the input cardinality. So as long as the input cardinality is correct 
(e.g. from HBO), the planner has correct cardinality estimation on the 
AnalyticEvalNode. I don't think it's worth tracking cardinality of 
AnalyticEvalNodes (PS13 removes the use/store of them). Then we don't need 
partial match here.

The value of this patch is adding AnalyticEvalNode into the HBO key string of 
parent nodes (e.g. AggregationNode, JoinNode) so we can still track their 
cardinality in HBO. In such scenario, the analytic results might be used as 
group-by/join keys. Then we can't use partial match. But there are cases that 
partial match or ignoring AnalyticEvalNode do help. Filed IMPALA-15590 to track 
this optimization.

> You could have 2 or more analytic nodes stacked on top of each other, all 
> sharing a common 'compatible partition'

This is something we can optimize. Currently the order matters. Filed 
IMPALA-15591 to track this.



--
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: 13
Gerrit-Owner: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Aleksandr Efimov <[email protected]>
Gerrit-Reviewer: Aman Sinha <[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, 20 Oct 2026 05:30:30 +0000
Gerrit-HasComments: Yes

Reply via email to