-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat(rust,python,cli): add SQL support for UNION [ALL] BY NAME
, add "diagonal_relaxed" strategy for pl.concat
#11597
feat(rust,python,cli): add SQL support for UNION [ALL] BY NAME
, add "diagonal_relaxed" strategy for pl.concat
#11597
Conversation
UNION [ALL] BY NAME
, and make internal concat functions a little more consistentUNION [ALL] BY NAME
, add "diagonal_relaxed" strategy for concat
, and make internal concat functions a little more consistent
2020a70
to
19157e4
Compare
UNION [ALL] BY NAME
, add "diagonal_relaxed" strategy for concat
, and make internal concat functions a little more consistentUNION [ALL] BY NAME
, add "diagonal_relaxed" strategy for concat
, make internal concat functions more consistent
e53ec46
to
683829f
Compare
UNION [ALL] BY NAME
, add "diagonal_relaxed" strategy for concat
, make internal concat functions more consistentUNION [ALL] BY NAME
, add "diagonal_relaxed" strategy for concat
UNION [ALL] BY NAME
, add "diagonal_relaxed" strategy for concat
UNION [ALL] BY NAME
, add "diagonal_relaxed" strategy for pl.concat
…d unify internal concat/diagonal api
0da2e92
to
d947d8d
Compare
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.
Nice! Small remark that saves a heap allocation. Other than that, good to go. 👍
I think many people like a relaxed diagonal. :)
Thanks for this @alexander-beedie - a very neat addition \o/ Just a small note, I didn't see how : {‘vertical’, ‘vertical_relaxed’, ‘diagonal’, ‘horizontal’, ‘align’} I can make a PR if needed, or perhaps it's simpler for you to add it as it is a 1 word change. |
Sounds like a plan; I'll be adding/fixing batched |
Issues closed
⭐ "Three for the price of one..."
Additional ref: #8917 (comment).
Closes #9370.
Closes #9891.
Closes #9412.
TLDR
pl.concat
strategy "diagonal_relaxed".SELECT * FROM df1 UNION ALL BY NAME SELECT * FROM df2
.True
by default forUNION
ops iif coming from the SQL interface, as this is the expected behaviour in that environment.Miscellaneous
While adding diagonal support for the "to_supertypes" param I also standardised the Rust-side function names for consistency/clarity, and updated the diagonal variant signature to match the standard concat, such that they both now take exactly the same
UnionArgs
enum (instead of breaking out the args as standalone params, as was previously done).hor_concat_df
→concat_df_horizontal
diag_concat_df
→concat_df_diagonal
diag_concat_lf
→concat_lf_diagonal
Examples
Setup sample frame data:
Demonstrate new
pl.concat
strategy:Demonstrate equivalent/new SQL support:
Bonus: while down this rabbit hole I also made an upstream PR with
sqlparser-rs
to supportUNION DISTINCT BY NAME
; we don't need to wait on that as theDISTINCT
keyword is (functionally) optional.