feat: Support "BY NAME" qualifier for SQL
"INTERSECT" and "EXCEPT" set ops
#17835
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.
Updates
sqlparser-rs
to 0.49 to take advantage of some PRs I've made upstream.BY NAME
qualifier across all set ops; like the existing support for this inUNION
, the modifier aligns the second frame to the first by column name (in much the same way as "diagonal" frame concat).Struct
field selection in the SQL engine,RENAME
andREPLACE
select wildcard options #17109 by enablingSELECT * REPLACE … RENAME …
query patterns (previously you could not use both REPLACE and RENAME in the same sequence of SELECT modifiers - with the upstream fix available, now you can).Example
Setup:
Use of the
BY NAME
qualifier automatically aligns the columns in the second DataFrame to those in the first (note that we also support the PostgreSQLTABLE tbl
shortcut, which is equivalent toSELECT * FROM tbl
):Reference
sqplarser-rs
updates:BY NAME
quantifier across all set ops apache/datafusion-sqlparser-rs#1309SELECT *
wildcardREPLACE ... RENAME
order apache/datafusion-sqlparser-rs#1321