Remove as_any from scalar UDF trait definition#20812
Open
timsaucer wants to merge 5 commits intoapache:mainfrom
Open
Remove as_any from scalar UDF trait definition#20812timsaucer wants to merge 5 commits intoapache:mainfrom
timsaucer wants to merge 5 commits intoapache:mainfrom
Conversation
Member
Author
|
@emilk You inspired me to cut almost 1200 lines of code. |
49d8d72 to
16b5190
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Which issue does this PR close?
None.
Rationale for this change
This PR reduces the amount of boilerplate code that users need to write for scalar UDFs. I didn't address aggregate or window functions yet just to keep the size of the PR manageable.
What changes are included in this PR?
Now that we have trait upcasting since rust 1.86, we no longer need every implementation of
ScalarUDFImplto have theas_anyfunction that returns&self. This PR makesAnyan supertrait forScalarUDFImpland makes the appropriate casts when necessary. The overall diff is about 1200 lines of code removed.Are these changes tested?
Existing unit tests.
Are there any user-facing changes?
Users simply need to remove the
as_any()function from their implementations.