alamb opened a new issue, #8708: URL: https://github.com/apache/arrow-datafusion/issues/8708
### Is your feature request related to a problem or challenge? ### Is your feature request related to a problem or challenge? For many of the same reasons as listed on https://github.com/apache/arrow-datafusion/issues/8045, having two types of aggregate functions ("built in" -- [datafusion](https://docs.rs/datafusion/latest/datafusion/index.html)::[physical_plan](https://docs.rs/datafusion/latest/datafusion/physical_plan/index.html)::[aggregates](https://docs.rs/datafusion/latest/datafusion/physical_plan/aggregates/index.html)::[AggregateFunction](https://docs.rs/datafusion/latest/datafusion/physical_plan/aggregates/enum.AggregateFunction.html#)) and [AggregateUDF](https://docs.rs/datafusion/latest/datafusion/physical_plan/udaf/struct.AggregateUDF.html#) is problematic for two reasons: 1. There are some features not available to User Defined Aggregate Functions (such as the faster `GroupsAccumulator` interface) 2. Users can not easily choose which aggregate functions to include (for example, do they want to allow (and pay the code size / compile time) for the [Statistical](https://arrow.apache.org/datafusion/user-guide/sql/aggregate_functions.html#statistical) and [Approximate](https://arrow.apache.org/datafusion/user-guide/sql/aggregate_functions.html#approximate) functions The second also ends up causing pushback on adding new aggregates (like `ARRAY_SUM` in https://github.com/apache/arrow-datafusion/pull/8325) and geospatial support https://github.com/apache/arrow-datafusion/issues/7859. ### Describe the solution you'd like I propose moving DataFusion to **only** use `AggregateUDF`s and remove the built in list of AggregateFunctions for the same reasons as https://github.com/apache/arrow-datafusion/issues/8045 We will keep the existing `AggregateUDF` interface as much as possible, while also potentially providing an easier way to define them. ### Describe alternatives you've considered ### Additional context Proposed implementation steps: - [x] Add trait based Aggregate ### Describe the solution you'd like _No response_ ### Describe alternatives you've considered _No response_ ### Additional context _No response_ -- 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]
