Skip to content

Conversation

@hvanhovell
Copy link
Contributor

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.

@hvanhovell
Copy link
Contributor Author

cc @EnricoMi

@hvanhovell
Copy link
Contributor Author

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))))
Copy link
Member

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?

Copy link
Contributor Author

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.

@EnricoMi
Copy link
Contributor

EnricoMi commented Sep 9, 2024

Thanks for the public helper method, will test this once it is in the snapshot.

@hvanhovell
Copy link
Contributor Author

I will update this once #48146 is merged.

@hvanhovell
Copy link
Contributor Author

Merging to master.

@asfgit asfgit closed this in 0c234bb Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants