andygrove opened a new pull request, #2796: URL: https://github.com/apache/datafusion-ballista/pull/2796
# Which issue does this PR close? No single issue. Split out of #2792. Related: #2520 (performance review tracking), #2318 (buffering shuffle output in memory). # Rationale for this change Aggregates emit their output as one large array sliced into batch-size pieces. The sort shuffle writer summed `get_array_memory_size` per buffered batch, which counts the whole shared buffer for every slice. After the first slice the 256 MiB per-task budget looked exceeded, and the writer spilled on almost every batch: TPC-H q18's partial aggregate stage spilled 1,145 times per input partition at SF100. At SF1000 the extra spill volume pushes q5 and q18 past DataFusion's 100 GB spill cap (see the separate spill-limit PR). # What changes are included in this PR? The sort shuffle buffer and `BufferExec`'s dam use DataFusion's `RecordBatchMemoryCounter`, which counts each underlying buffer once across batches. A test checks that slices of one array are counted once. # Are there any user-facing changes? No config or API changes. Shuffle writes of sliced batches spill far less. -- 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]
