Skip to content

chore: remove as_any from aggregate and window functions - #21209

Merged
timsaucer merged 9 commits into
apache:mainfrom
timsaucer:feat/remove-as-any-agg-window
Mar 30, 2026
Merged

chore: remove as_any from aggregate and window functions#21209
timsaucer merged 9 commits into
apache:mainfrom
timsaucer:feat/remove-as-any-agg-window

Conversation

@timsaucer

Copy link
Copy Markdown
Member

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 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.

@timsaucertimsaucer self-assigned this Mar 27, 2026
@timsaucertimsaucer added the api change Changes the API exposed to users of the crate label Mar 27, 2026
@github-actionsgithub-actionsBot added documentation Improvements or additions to documentation logical-expr Logical plan and expressions optimizer Optimizer rules core Core DataFusion crate proto Related to proto crate functions Changes to functions implementation ffi Changes to the ffi crate spark labels Mar 27, 2026
@github-actionsgithub-actionsBot added the physical-expr Changes to the physical-expr crates label Mar 27, 2026
@timsaucer

Copy link
Copy Markdown
MemberAuthor

Thank you @xudong963 !

@timsaucer
timsaucer added this pull request to the merge queueMar 30, 2026
Merged via the queue into apache:main with commit 14a85faMar 30, 2026
35 checks passed
@timsaucer
timsaucer deleted the feat/remove-as-any-agg-window branch March 30, 2026 20:20
github-merge-queueBot 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-queueBot 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>
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#20812apache#21209apache#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#20812apache#21209apache#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>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api changeChanges the API exposed to users of the cratecoreCore DataFusion cratedocumentationImprovements or additions to documentationffiChanges to the ffi cratefunctionsChanges to functions implementationlogical-exprLogical plan and expressionsoptimizerOptimizer rulesphysical-exprChanges to the physical-expr cratesprotoRelated to proto cratespark

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@timsaucer@xudong963@alamb