-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-49369][CONNECT][SQL] Add implicit Column conversions #48020
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
Conversation
|
cc @EnricoMi |
|
Shout-out to @larsk-db and @vkorukanti for this idea! |
| .setCustomField("abc") | ||
| .build() | ||
| simple.select(column(_.setExtension(com.google.protobuf.Any.pack(extension)))) | ||
| simple.select(Column(_.setExtension(com.google.protobuf.Any.pack(extension)))) |
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.
Why don't we just have column method?
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.
It is more to illustrate that the old way works. You can actually use both.
|
Thanks for the public helper method, will test this once it is in the snapshot. |
|
I will update this once #48146 is merged. |
|
Merging to master. |
What changes were proposed in this pull request?
This introduces an implicit conversion for the Column companion object that allows a user/developer to create a Column from a catalyst Expression (for Classic) or a proto Expression (Builder) (for Connect). This mostly recreates they had before we refactored the Column API. This comes at the price of adding the an import.
Why are the changes needed?
Improved upgrade experience for Developers and User who create their own Column's from expressions.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
I added it to a couple of places in the code and it works.
Was this patch authored or co-authored using generative AI tooling?
No.