Remove as_any from scalar UDF trait definition#20812
Merged
timsaucer merged 7 commits intoapache:mainfrom Mar 26, 2026
Merged
Conversation
Member
Author
|
@emilk You inspired me to cut almost 1200 lines of code. |
49d8d72 to
16b5190
Compare
16b5190 to
7b98c6c
Compare
Contributor
|
I can't believe I looked at all those remove lines. LGTM |
Member
Author
|
@Omega359 Would you be willing to hit the approve button? |
Contributor
|
I'm not a committer @timsaucer. Trust me, I'd like to be but my company never approved it. |
Member
Author
|
@Omega359 You should still be able to submit reviews, unless that is also out of scope for company reasons. |
Omega359
reviewed
Mar 24, 2026
alamb
approved these changes
Mar 24, 2026
Contributor
alamb
left a comment
There was a problem hiding this comment.
This is a great idea -- thanks @timsaucer and @Omega359
It will require downstream churn but I it should be pretty mechanical (as you say)
fec0b24 to
084ace2
Compare
084ace2 to
a591790
Compare
Contributor
|
EPIC |
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Mar 30, 2026
## Which issue does this PR close? This is a follow on to #20812 but treats aggregate and window functions. ## Rationale for this change This PR reduces the amount of boilerplate code that users need to write for aggregate and window functions. ## What changes are included in this PR? Now that we have [trait upcasting](https://blog.rust-lang.org/2025/04/03/Rust-1.86.0/) since rust 1.86, we no longer need every implementation of these functions to have the as_any function that returns &self. This PR makes Any an supertrait and makes the appropriate casts when necessary. ## Are these changes tested? Existing unit tests. ## Are there any user-facing changes? Yes, the users simply need to remove the `as_any` function. The upgrade guide is updated. --------- Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Apr 3, 2026
## Which issue does this PR close? This is a follow on to #20812 and #21209 but treats `ExecutionPlan`. ## Rationale for this change This PR reduces the amount of boilerplate code that users need to write for execution plans. ## What changes are included in this PR? Now that we have [trait upcasting](https://blog.rust-lang.org/2025/04/03/Rust-1.86.0/) since rust 1.86, we no longer need every implementation of these functions to have the as_any function that returns &self. This PR makes Any an supertrait and makes the appropriate casts when necessary. I have also implemented functions `is` and `downcast_ref` on the trait object for ExecutionPlan and applied this same pattern to the udf, udaf, and udwf implementations. This allows for a clean downcasting and type checking. ## Are these changes tested? Existing unit tests. ## Are there any user-facing changes? Yes, the users simply need to remove the `as_any` function. The upgrade guide is updated. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Apr 12, 2026
…d CatalogProviderList (#21346) ## Which issue does this PR close? This is a follow on to #20812 #21209 #21263 but treats `TableProvider`, `SchemaProvider`, `CatalogProvider`, and `CatalogProviderList`. ## Rationale for this change This PR reduces the amount of boilerplate code that users need to write for catalogs through table providers. ## What changes are included in this PR? Now that we have [trait upcasting](https://blog.rust-lang.org/2025/04/03/Rust-1.86.0/) since rust 1.86, we no longer need every implementation of these functions to have the as_any function that returns &self. This PR makes Any an supertrait and makes the appropriate casts when necessary. ## Are these changes tested? Existing unit tests. ## Are there any user-facing changes? Yes, the users simply need to remove the `as_any` function. The upgrade guide is updated. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
16 tasks
coderfender
pushed a commit
to coderfender/datafusion
that referenced
this pull request
Apr 14, 2026
…d CatalogProviderList (apache#21346) ## Which issue does this PR close? This is a follow on to apache#20812 apache#21209 apache#21263 but treats `TableProvider`, `SchemaProvider`, `CatalogProvider`, and `CatalogProviderList`. ## Rationale for this change This PR reduces the amount of boilerplate code that users need to write for catalogs through table providers. ## What changes are included in this PR? Now that we have [trait upcasting](https://blog.rust-lang.org/2025/04/03/Rust-1.86.0/) since rust 1.86, we no longer need every implementation of these functions to have the as_any function that returns &self. This PR makes Any an supertrait and makes the appropriate casts when necessary. ## Are these changes tested? Existing unit tests. ## Are there any user-facing changes? Yes, the users simply need to remove the `as_any` function. The upgrade guide is updated. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rich-T-kid
pushed a commit
to Rich-T-kid/datafusion
that referenced
this pull request
Apr 21, 2026
## Which issue does this PR close? This is a follow on to apache#20812 but treats aggregate and window functions. ## Rationale for this change This PR reduces the amount of boilerplate code that users need to write for aggregate and window functions. ## What changes are included in this PR? Now that we have [trait upcasting](https://blog.rust-lang.org/2025/04/03/Rust-1.86.0/) since rust 1.86, we no longer need every implementation of these functions to have the as_any function that returns &self. This PR makes Any an supertrait and makes the appropriate casts when necessary. ## Are these changes tested? Existing unit tests. ## Are there any user-facing changes? Yes, the users simply need to remove the `as_any` function. The upgrade guide is updated. --------- Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Rich-T-kid
pushed a commit
to Rich-T-kid/datafusion
that referenced
this pull request
Apr 21, 2026
## Which issue does this PR close? This is a follow on to apache#20812 and apache#21209 but treats `ExecutionPlan`. ## Rationale for this change This PR reduces the amount of boilerplate code that users need to write for execution plans. ## What changes are included in this PR? Now that we have [trait upcasting](https://blog.rust-lang.org/2025/04/03/Rust-1.86.0/) since rust 1.86, we no longer need every implementation of these functions to have the as_any function that returns &self. This PR makes Any an supertrait and makes the appropriate casts when necessary. I have also implemented functions `is` and `downcast_ref` on the trait object for ExecutionPlan and applied this same pattern to the udf, udaf, and udwf implementations. This allows for a clean downcasting and type checking. ## Are these changes tested? Existing unit tests. ## Are there any user-facing changes? Yes, the users simply need to remove the `as_any` function. The upgrade guide is updated. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rich-T-kid
pushed a commit
to Rich-T-kid/datafusion
that referenced
this pull request
Apr 21, 2026
…d CatalogProviderList (apache#21346) ## Which issue does this PR close? This is a follow on to apache#20812 apache#21209 apache#21263 but treats `TableProvider`, `SchemaProvider`, `CatalogProvider`, and `CatalogProviderList`. ## Rationale for this change This PR reduces the amount of boilerplate code that users need to write for catalogs through table providers. ## What changes are included in this PR? Now that we have [trait upcasting](https://blog.rust-lang.org/2025/04/03/Rust-1.86.0/) since rust 1.86, we no longer need every implementation of these functions to have the as_any function that returns &self. This PR makes Any an supertrait and makes the appropriate casts when necessary. ## Are these changes tested? Existing unit tests. ## Are there any user-facing changes? Yes, the users simply need to remove the `as_any` function. The upgrade guide is updated. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.