You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
COUNT(DISTINCT) on Decimal32/Decimal64 doesn’t use the native distinct accumulator #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
Activity
tjnangosha commentedon Oct 27, 2026
take
perf: use native distinct accumulator for COUNT(DISTINCT) on Decimal3…