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

[SPARK-50983][SQL]Part 1.b Add analyzer support for nested correlated subqueries #50548

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

Conversation

AveryQi115
Copy link
Contributor

What changes were proposed in this pull request?

Add support for nested correlated subqueries.

Why are the changes needed?

Support for nested correlated subqueries.

Does this PR introduce any user-facing change?

How was this patch tested?

Current UT and Suite.

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

No

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

cc: @agubichev
This depends on the definition change in this pr #50285

"fields" -> plan.inputSet.map(f => toSQLId(f.name)).mkString(", "))
)
}
res
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to extract nested outer aggs in UpdateOuterReferences?

case other =>
other.resolveChildren(nameParts, conf.resolver).map(wrapOuterReference)
val outerPlans = outerPlanContext.get
val resolvedExpressions = outerPlans.flatMap {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the resolution be backwards? From the lower outer plan to the upper. As far as I can see, the lower outer plan is the last one.

@@ -25,16 +25,10 @@ import scala.collection.mutable.ArrayBuffer
import scala.jdk.CollectionConverters._
Copy link
Contributor

Choose a reason for hiding this comment

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

Any chance to add SQL golden file tests just for Analyzed plans for this PR?

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.

2 participants