kwai / blaze

Blazing-fast query execution engine speaks Apache Spark language and has Arrow-DataFusion at its core.
Apache License 2.0
1.3k stars 121 forks source link

implement columnar accumulator states #645

Closed richox closed 1 day ago

richox commented 1 week ago

Is your feature request related to a problem? Please describe. in HashAggregateExec, currently all accumutors share the same AccumRow in one grouped record, which requires a lot of bytes-hacking and the performance is not good. we should consider using seperated row for each accumulator, so that we can update each AccumColumn independently. only convert columns to rows when doing partial merging.

Describe the solution you'd like

  1. implement a common trait AccumColumn, replacing the old AccumRow.
  2. implement columnar updating/merging.
  3. implement C2R for partial merging.

Describe alternatives you've considered further more, we can use columnar storage for partial merging, this requires more complex handling of output schema of partial aggr. Additional context