Quanlong Huang has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/24718


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

IMPALA-15278: Fix incorrect cardinality with OFFSET

OFFSET is used to skip a number of rows before returning results. When
calculating cardinality of a node that has OFFSET, the cardinality
should substract this number before applying the LIMIT.

MERGING-EXCHANGE currently does the reverse which could results in 0
cardinality when OFFSET >= LIMIT. SortNode currently ignores the offset.
This fixes both issue by adding an overload of capCardinalityAtLimit()
that has a parameter for offset. It's used in ExchangeNode and SortNode.

Tests
 - Added FE test
 - Ran PlannerTest

Change-Id: I3b628beabc5c7ec6c4fdda9dff6aaf7a4acae538
---
M fe/src/main/java/org/apache/impala/planner/ExchangeNode.java
M fe/src/main/java/org/apache/impala/planner/PlanNode.java
M fe/src/main/java/org/apache/impala/planner/SortNode.java
M fe/src/test/java/org/apache/impala/planner/PlannerTest.java
M 
testdata/workloads/functional-planner/queries/PlannerTest/inline-view-limit.test
M 
testdata/workloads/functional-planner/queries/PlannerTest/subquery-rewrite.test
6 files changed, 29 insertions(+), 17 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/18/24718/1
--
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: newchange
Gerrit-Change-Id: I3b628beabc5c7ec6c4fdda9dff6aaf7a4acae538
Gerrit-Change-Number: 24718
Gerrit-PatchSet: 1
Gerrit-Owner: Quanlong Huang <[email protected]>

Reply via email to