Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: Support uncorrelated EXISTS #14474

Merged

Conversation

findepi
Copy link
Member

@findepi findepi commented Feb 4, 2025

For the purpose of decorrelation, an uncorrelated plan is a unit. No
verification needs to be performed on it.
Extract variable from a long if condition involving a match. Improves
readability.
Handle the unhandled case returning immediately. This adds additional
return point to the function, but removes subsequent if. At the point of
this additional return we know why we bail out (some unhandled
situation), later the None filter could be construed as a true
condition.
@github-actions github-actions bot added logical-expr Logical plan and expressions optimizer Optimizer rules sqllogictest SQL Logic Tests (.slt) labels Feb 4, 2025
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @findepi -- this looks like a nice improvement to me

Copy link
Contributor

@goldmedal goldmedal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @findepi. This way makes sense to me. 👍
I just noticed some comments may be out of date.

datafusion/sqllogictest/test_files/subquery.slt Outdated Show resolved Hide resolved
datafusion/optimizer/src/decorrelate_predicate_subquery.rs Outdated Show resolved Hide resolved
@findepi findepi changed the title Support uncorrelated EXISTS core: Support uncorrelated EXISTS Feb 5, 2025
@findepi findepi merged commit 61ab9d0 into apache:main Feb 5, 2025
26 checks passed
@findepi findepi deleted the findepi/support-uncorrelated-exists-d3ccb0 branch February 5, 2025 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logical-expr Logical plan and expressions optimizer Optimizer rules sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

check_correlations_in_subquery should not check uncorrelated plan nodes
3 participants