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

Change subject: IMPALA-15278: Fix incorrect cardinality with OFFSET
......................................................................


Patch Set 3:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/24718/3/fe/src/main/java/org/apache/impala/planner/PlanNode.java
File fe/src/main/java/org/apache/impala/planner/PlanNode.java:

http://gerrit.cloudera.org:8080/#/c/24718/3/fe/src/main/java/org/apache/impala/planner/PlanNode.java@816
PS3, Line 816:   protected long capCardinalityAtLimit(long cardinality, long 
offset) {
> That makes sense. applySelectivity() also does this for IMPALA-8647.
Checked it out: subquery-rewrite.test is gone from the patch, so the NESTED 
LOOP JOIN keeps its RIGHT SEMI shape and the inputs no longer swap. The wording 
matches applySelectivity() at line 939 too, so the two places now read the 
same. Looks settled.


http://gerrit.cloudera.org:8080/#/c/24718/3/testdata/workloads/functional-planner/queries/PlannerTest/card-limit-offset.test
File 
testdata/workloads/functional-planner/queries/PlannerTest/card-limit-offset.test:

http://gerrit.cloudera.org:8080/#/c/24718/3/testdata/workloads/functional-planner/queries/PlannerTest/card-limit-offset.test@16
PS3, Line 16: # OFFSET in MERGING-EXCHANGE
> Added such tests.
The two new sections cover it. I recomputed the numbers against the new formula 
rather than reading them off: 730 - 6200 clamps to 1 in the TOP-N, and in the 
distributed shape the local TOP-N stays at 730 while the merging exchange 
clamps to 1. Both match the goldens.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3b628beabc5c7ec6c4fdda9dff6aaf7a4acae538
Gerrit-Change-Number: 24718
Gerrit-PatchSet: 3
Gerrit-Owner: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Aleksandr Efimov <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Comment-Date: Tue, 01 Sep 2026 06:32:56 +0000
Gerrit-HasComments: Yes

Reply via email to