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

[WIP][SPARK-50983][SQL] Support Nested Correlated Subqueries for Analyzer #49660

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

AveryQi115
Copy link
Contributor

What changes were proposed in this pull request?

  1. Analyzer is using same outer plan context to resolve subquery if there is outer plan context defined, otherwise it uses the outer plan provided by the function as context.

  2. Add unresolvedOuterAttrs argument for SubqueryExpression to record outerAttrs cannot be resolved in the immediate parent query but might be resolved in other ancestor queries.

Why are the changes needed?

Support Nested Correlated Subqueries for Analyzer needed for decorrelating nested correlated subqueries.

Does this PR introduce any user-facing change?

yes, add a user-facing config to enable analyzer to support nested correlated subqueries.

How was this patch tested?

WIP

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the SQL label Jan 24, 2025
@AveryQi115
Copy link
Contributor Author

cc: @agubichev for review

@AveryQi115
Copy link
Contributor Author

AveryQi115 commented Jan 24, 2025

WIP:

  • tests
  • subError class marking unresolvedOuterAttrs are not within OuterAttrs
  • check if these changes affect other operators which will turn into Subqueries, eg: UDF, CTE...
  • currently the feature cannot be turned on as optimizer is not ready yet, may need to add another config to check if optimizer supports nested correlated subqueries

@AveryQi115 AveryQi115 changed the title [SPARK-50983][SQL] Support Nested Correlated Subqueries for Analyzer [WIP][SPARK-50983][SQL] Support Nested Correlated Subqueries for Analyzer Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant