Skip to content

IMPALA-14714: Fix incorrect results for anti-join with constant ON cl…#10

Open
zhangyifan27 wants to merge 1 commit intomasterfrom
IMPALA-14714
Open

IMPALA-14714: Fix incorrect results for anti-join with constant ON cl…#10
zhangyifan27 wants to merge 1 commit intomasterfrom
IMPALA-14714

Conversation

@zhangyifan27
Copy link
Owner

…ause predicates

This patch fixes incorrect query results when using LEFT/RIGHT ANTI JOIN with constant predicates in the ON clause (e.g., ON FALSE or ON TRUE).

Previously, constant anti-join predicates were incorrectly handled:

  • They were marking the entire query as having an empty result set
  • They were being assigned to scan nodes instead of join nodes
  • They were being migrated into inline views incorrectly

The fix adds special handling for anti-join conjuncts in Analyzer to:

  1. Skip them in markConstantConjunct() to avoid marking query as empty
  2. Route constant ON clause predicates to canEvalOnClauseConjunct()
  3. Ensure constant anti-join predicates are evaluated at join nodes
  4. Prevent migration of anti-join predicates into inline views

Testing:

  • Added comprehensive test cases covering ON FALSE, ON TRUE, and mixed predicates for both LEFT and RIGHT ANTI JOIN

Change-Id: I0e0f4a69263bb0ff11f421a1a340dffb904c6842

…ause predicates

This patch fixes incorrect query results when using LEFT/RIGHT ANTI JOIN
with constant predicates in the ON clause (e.g., ON FALSE or ON TRUE).

Previously, constant anti-join predicates were incorrectly handled:
- They were marking the entire query as having an empty result set
- They were being assigned to scan nodes instead of join nodes
- They were being migrated into inline views incorrectly

The fix adds special handling for anti-join conjuncts in Analyzer to:
1. Skip them in markConstantConjunct() to avoid marking query as empty
2. Route constant ON clause predicates to canEvalOnClauseConjunct()
3. Ensure constant anti-join predicates are evaluated at join nodes
4. Prevent migration of anti-join predicates into inline views

Testing:
- Added comprehensive test cases covering ON FALSE, ON TRUE, and mixed
  predicates for both LEFT and RIGHT ANTI JOIN

Change-Id: I0e0f4a69263bb0ff11f421a1a340dffb904c6842
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant