[SPARK-51728][SQL] Add SELECT EXCEPT Support #50536
Open
+42
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Jira - https://issues.apache.org/jira/browse/SPARK-51728
This change introduces support for the
SELECT * EXCEPT(col1, col2, ...)
syntax, which allows users to project all columns from a dataset except for a specified subset. This pattern is especially useful in wide tables where explicitly listing all desired columns would be verbose and error-prone.The syntax is already widely adopted in other SQL engines like BigQuery (docs), and adding support in Spark SQL helps improve compatibility, reduce boilerplate, and improve developer ergonomics when working with large schemas.
Why are the changes needed?
I think
SELECT EXCEPT
it's useful when working with large schemas and other DBMSes have it (e.g BigQuery) so I think it'd be good to add support in Spark as wellDoes this PR introduce any user-facing change?
It doesn't include changes as it'd be a new feature
How was this patch tested?
It was tested in
SQLQuerySuite
by adding a dedicated test toSELECT EXCEPT
Was this patch authored or co-authored using generative AI tooling?
No