Improve performance of Avg
aggregate: implement convert_to_state
#11816
Labels
enhancement
New feature or request
Avg
aggregate: implement convert_to_state
#11816
Is your feature request related to a problem or challenge?
@korowa added "skip partial aggregation mode" in #11627 which helps with high cardinality aggregates by doing minimal work for the first phase of the aggregation. This mode is triggered dynamically based on how effective the first aggregation phase is working.
In order to use this new mode, the corresponding
GroupsAccumulator
needs to implement theconvert_to_state
methoddatafusion/datafusion/expr/src/groups_accumulator.rs
Lines 166 to 213 in c340b6a
Describe the solution you'd like
Implement
covert_to_state
forhttps://github.com/apache/datafusion/blob/66a85706f6c5dc5eabcc09b0990d84c6f8879b81/datafusion/functions-aggregate/src/average.rs#L430-L429
Add tests in
datafusion/datafusion/sqllogictest/test_files/aggregate_skip_partial.slt
Lines 18 to 19 in c340b6a
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: