Rachelint opened a new pull request, #26112: URL: https://github.com/apache/datafusion/pull/26112
## Which issue does this PR close? None. Experimental follow-up to #26109; do not merge yet. ## Rationale for this change Partial aggregation can flush a small working set repeatedly. #26109 retains the single StringView hash table and reserves its payload, but other group-key buffers still grow again after each flush. This experiment extends allocation retention and replacement-buffer reservation to other key types. ## What changes are included in this PR? Based on #26109 at `522c7492f0ee2596a8d244c46bda805196f786e2` (and the byte/row threshold experiment in #26100): - Reserve single StringView views as well as payload; retain hash scratch storage. - Retain primitive and byte-key hash tables, and reserve replacement key buffers using the previous emitted lengths. - Keep multi-column builders and scratch Vec capacities across threshold flushes. Reserve primitive, byte, view, fixed-size-binary, list and dictionary storage; retain row-backed storage where output is independent. - Extend contiguous StringView payload storage to multi-column view keys. - Preserve aggregate batch-group-index capacity on threshold flushes. - Count retained capacities in the existing working-set threshold and memory reservation. Memory-pressure emission keeps releasing allocations. Output batches own emitted buffers. Replacement buffers are reserved for the next cycle; live output buffers are never overwritten. ## What is the testing strategy for this PR? Passed: - `cargo fmt --all` and `git diff --check`. - `cargo clippy --all-targets --all-features -- -D warnings`. - 141 group-values tests, including three successive flush/refill cycles across nullable primitive, strings/views, mixed, list, dictionary, fixed-size-binary and row-backed keys while retaining earlier outputs. - 39 binary-map/view-map tests. - `aggregate_partial_flush.slt`, checking integers, strings, views, mixed keys, nulls, distinct and aggregate states. - Generated config documentation and `doc_prettier_check.sh --write --allow-dirty`. ECS full ClickBench comparison is running: all 43 queries; main (`7b1e55d4`), #26109 (`522c7492`) and this branch. Both candidates use 2 MiB / zero row threshold, 12 partitions, batch size 8192 and CPUs 0-11. Two reversed rounds, four iterations per cell, discarding the first iteration. Results will be added after completion. ## Are there any user-facing changes? Only when the experimental Partial flush thresholds are enabled (both default to zero). More group-key allocation capacity survives threshold flushes. Final aggregation and its bucket behavior are unchanged. -- 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]
