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

Change subject: IMPALA-15690: Support HBO for SubplanNode cardinality
......................................................................


Patch Set 3:

(2 comments)

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

http://gerrit.cloudera.org:8080/#/c/25221/3/fe/src/main/java/org/apache/impala/planner/SubplanNode.java@109
PS3, Line 109:   public String generateHboKeyString(THboStatsType statsType,
SubplanNode inherits buildHboOperandQualifierMap(), which gives a.id and b.id 
the same operand path. Changing the last ON clause below to b.id = c.id 
therefore keeps the parent join's HBO key unchanged:

```sql
select straight_join a.id
from t a join t b on a.id < b.id
left join a.arr x on true
join s c on a.id = c.id;
```

Reproduced on PS3: the queries returned 47 and 19 rows on my test data, but the 
second read 47 from HBO. Could we preserve the input column identities in the 
Subplan output mapping and add a regression test?


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

http://gerrit.cloudera.org:8080/#/c/25221/3/fe/src/main/java/org/apache/impala/planner/UnnestNode.java@181
PS3, Line 181:       paths.add(String.join(".", 
ref.getDesc().getPath().getCanonicalPath()));
On PS3, a.arr and b.arr both become db.t.arr here, so changing the collection 
in this query keeps the same HBO key:

```sql
select straight_join a.id
from t a join t b on a.id < b.id
left join a.arr x on true
where a.id = 1 and b.id = 2;
```

With array lengths 1 and 3, the queries return 1 and 3 rows, but the second 
reads the first query's history and gets an estimate of 1. Could we include the 
owning input operand in the collection key and add a self-join test?



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I92c9e2e70450fc64141a40848508d69afe93d564
Gerrit-Change-Number: 25221
Gerrit-PatchSet: 3
Gerrit-Owner: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Aleksandr Efimov <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Comment-Date: Fri, 30 Oct 2026 13:06:32 +0000
Gerrit-HasComments: Yes

Reply via email to