timsaucer opened a new pull request, #20812: URL: https://github.com/apache/datafusion/pull/20812
## 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](https://blog.rust-lang.org/2025/04/03/Rust-1.86.0/) since rust 1.86, we no longer need every implementation of `ScalarUDFImpl` to have the `as_any` function that returns `&self`. This PR makes `Any` an supertrait for `ScalarUDFImpl` and 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. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
