Rich-T-kid opened a new pull request, #27741: URL: https://github.com/apache/datafusion/pull/27741
## Which issue does this PR close? N/A — stacked performance follow-up to #27707. ## Rationale for this change This PR is stacked on #27707 at `8a4e97e53ebee18e6761dd67f4dd4e92caf244c6`. Indexed output removed row materialization, but grouped hash/range output still builds a temporary collection before routing each selection and uses a hash map for dense output-partition lookup. This adds overhead as the number of output partitions grows. ## What changes are included in this PR? - Route `PartitioningOutput::Grouped` directly to the coalescer. - Use a dense `Vec<Option<OutputChannel>>` with a live-channel count for output routing and early receiver removal. - Size grouped partition ranges to the smaller of partition count and batch rows. - Add hash/range order, sparse/empty, all-to-one, high-partition-count, null/zero-column coverage; existing suite covers preserve-order, spill, round-robin, and dropped receivers. The stable counting-scatter experiment is intentionally excluded: it materially regressed skewed routing. ## What is the testing strategy for this PR? - `cargo test -p datafusion-physical-plan repartition::tests --lib` - `cargo clippy -p datafusion-physical-plan --all-targets --all-features -- -D warnings` - `cargo fmt --all` and `git diff --check` A disposable `RepartitionExec` harness compared this branch with `8a4e97e5` over 16 input partitions, 1,048,576 rows, 8 payload columns, uniform and 90% all-to-one skew. Every run checked row count and payload checksum; indexed rows matched (1,048,576) in all cases. Each pair reversed revision order. Negative is faster; sub-1% results are unresolved. | Output partitions | Uniform mean | Skewed mean | | ---: | ---: | ---: | | 8 | -2.68% | -1.84% | | 12 | +1.84% | +0.34% | | 16 | -3.66% | +0.51% | | 24 | -0.29% | -0.15% | | 32 | -1.82% | -1.60% | | 64 | -2.76% | -3.22% | | 96 | -6.67% | -1.42% | | 128 | -6.21% | -3.47% | | 192 | -1.59% | -1.93% | | 256 | -4.34% | -4.96% | | 384 | -5.24% | -4.28% | | 512 | -3.22% | -3.12% | Peak/average RSS was recorded for each case; it had no consistent direction. The full TPC-H partition matrix is being run by the benchmark bot against the exact stacked base. ## 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]
