Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,16 @@ && allCoveredBy(otherConjunct, join.left().getOutputSet())) {
leftConjuncts.add(otherConjunct);
} else if (PUSH_DOWN_RIGHT_VALID_TYPE.contains(join.getJoinType())
&& allCoveredBy(otherConjunct, join.right().getOutputSet())) {
rightConjuncts.add(otherConjunct);
// For NULL_AWARE_LEFT_ANTI_JOIN (NOT IN subquery), when hash join
// conjuncts are empty (no correlation), pushing other conditions to
// the right child would filter rows before the null-aware check,
// changing the NOT IN semantics. Keep them as remaining other
// conjuncts instead.
if (join.getJoinType().isNullAwareLeftAntiJoin() && join.getHashJoinConjuncts().isEmpty()) {
Comment thread
starocean999 marked this conversation as resolved.
remainingOther.add(otherConjunct);
} else {
rightConjuncts.add(otherConjunct);
}
} else {
remainingOther.add(otherConjunct);
}
Expand Down
3 changes: 3 additions & 0 deletions regression-test/data/query_p0/subquery/subquery_unnesting.out
Original file line number Diff line number Diff line change
Expand Up @@ -1535,3 +1535,6 @@
0
2

-- !select65 --
0

Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,9 @@ suite ("subquery_unnesting") {
from t1
order by kk
"""
qt_select65 """
SELECT COUNT(*) AS c
FROM (SELECT 1 AS x) t
WHERE 1 NOT IN (SELECT CAST(NULL AS INT));
"""
}
Loading