tjnangosha opened a new issue, #26820: URL: https://github.com/apache/datafusion/issues/26820
### Is your feature request related to a problem or challenge? `COUNT(DISTINCT)` on a Decimal32 or Decimal64 column is slower than on a Decimal128 column, even though the values are smaller. In the `count_distinct` benchmark, a batch of 8,192 Decimal32 values takes about 870 µs, compared with about 110 µs for Decimal128. `get_count_accumulator` in `datafusion/functions-aggregate/src/count.rs` sends Decimal128 and Decimal256 to `PrimitiveDistinctCountAccumulator`, but has no arm for Decimal32 or Decimal64. They fall through to the generic `DistinctCountAccumulator`, which converts every row into a `ScalarValue`. ### Describe the solution you'd like Add `Decimal32` and `Decimal64` arms to `get_count_accumulator` that use `PrimitiveDistinctCountAccumulator`, matching Decimal128 and Decimal256. ### Describe alternatives you've considered _No response_ ### Additional context _No response_ ### Willingness to contribute I plan to contribute to this feature independently -- 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]
