Yifan Zhang has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/23962 )

Change subject: IMPALA-14714: Fix incorrect results for anti-join with constant 
ON clause predicates
......................................................................


Patch Set 3:

> Patch Set 3:
>
> While working on IMPALA-7996 and separating its outer-join optimization from 
> the anti-join correctness changes, I found a remaining correctness case on 
> PS3 with constant inline views. For example:
>
> select a.*
> from (select 1 as id union all select 2 as id) a
> left anti join (select 1 as id union all select 2 as id) b on false;
>
> The preserved left input is planned with cardinality 0, so the expected two 
> rows are lost. ON NULL has the same issue. I reproduced this against exact 
> PS3. It appears the constant predicate is still consumed while planning the 
> inline-view input, so the current migration guard is not sufficient for this 
> shape. I can help prepare a regression and fix if useful.

Good catch, thanks — confirmed. The constant anti-join ON predicate is pushed 
into the union operands in createUnionPlan() (a path previous guard didn't 
cover), which empties the preserved input. I'll exclude anti-join conjuncts 
from that push-down so they're evaluated at the join node, and add regression 
tests in semi-joins.test.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0e0f4a69263bb0ff11f421a1a340dffb904c6842
Gerrit-Change-Number: 23962
Gerrit-PatchSet: 3
Gerrit-Owner: Yifan Zhang <[email protected]>
Gerrit-Reviewer: Aleksandr Efimov <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Steve Carlin <[email protected]>
Gerrit-Reviewer: Yifan Zhang <[email protected]>
Gerrit-Comment-Date: Wed, 22 Jul 2026 06:24:42 +0000
Gerrit-HasComments: No

Reply via email to