Skip to content

Implement GroupsAccumulator for map_agg UDAF#2

Closed
LiaCastaneda wants to merge 1 commit into
lia/map-aggfrom
lia/map-agg-groups-accumulator
Closed

Implement GroupsAccumulator for map_agg UDAF#2
LiaCastaneda wants to merge 1 commit into
lia/map-aggfrom
lia/map-agg-groups-accumulator

Conversation

@LiaCastaneda

Copy link
Copy Markdown
Owner

Which issue does this PR close?

  • follow-up to implement map_agg apache/datafusion#22996 -- this PR implement s a specialized GroupsAccumulator which different to the generic MapAggAccumulator, the difference is that MapAggAccumulator operates row-by-row, converting each key/value to ScalarValue, and DataFusion instantiates one per group. MapAggGroupsAccumulator handles all groups in a single instance, keeps data in columnar form, and uses a counting sort + arrow::compute::interleave to scatter rows into group order at emit time -- avoiding per-row scalar allocation.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

⚠️ This PR is still a draft, i'd like to add some benchmarks first to verify this actually improves perf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant