-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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-50601][SQL] Support withColumns / withColumnsRenamed in subqueries #49386
Conversation
cc @cloud-fan too |
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala
Outdated
Show resolved
Hide resolved
@@ -1275,29 +1275,15 @@ class Dataset[T] private[sql]( | |||
require(colNames.size == cols.size, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this check still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's still good to have to be fail-fast, especially for connect?
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala
Show resolved
Hide resolved
…ysis/unresolved.scala Co-authored-by: Wenchen Fan <[email protected]>
|
The remaining test failures are not related to this PR. |
Thanks! merging to master. |
What changes were proposed in this pull request?
Supports
withColumns
/withColumnsRenamed
in subqueries.Why are the changes needed?
When the query is used as a subquery by adding
col.outer()
,withColumns
orwithColumnsRenamed
doesn't work because they need analyzed plans.Does this PR introduce any user-facing change?
Yes, those APIs are available in subqueries.
How was this patch tested?
Added the related tests.
Was this patch authored or co-authored using generative AI tooling?
No.