neilconway opened a new pull request, #20504: URL: https://github.com/apache/datafusion/pull/20504
## Which issue does this PR close? - Closes #20465 . ## Rationale for this change This PR optimizes the performance of `array_agg()` by adding support for the `GroupsAccumulator` API. The design tries to minimize the amount of per-batch work done in `update_batch()`: we store a reference to the batch, and for each row, we store a `(batch_idx, row_idx)` pair for the row's group. In `evaluate()`, we assemble all the requested output with a single `interleave` call. This turns out to be significantly faster, especially when the `array_agg()` receives a lot of input. For example, on a benchmark with 5000 groups and 5000 int64 values per group, this approach is roughly 160x faster than the previous approach. ## What changes are included in this PR? * New `GroupsAccumulator` API for `array_agg()` * Unit tests * Improve SLT test coverage * Remove a redundant SLT test ## Are these changes tested? Yes, and benchmarked. ## Are there any user-facing changes? No. -- 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]
