fix: avoid buffering unbounded repartition output indefinitely - #24193
fix: avoid buffering unbounded repartition output indefinitely#24193goutamadwant wants to merge 1 commit into
Conversation
Skip producer-side batch coalescing for unbounded inputs so partial batches are not held until stream completion. Preserve bounded-input coalescing and cover the behavior with a pending unbounded source. Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #24193 +/- ##
==========================================
- Coverage 81.05% 81.05% -0.01%
==========================================
Files 1106 1106
Lines 382287 382325 +38
Branches 382287 382325 +38
==========================================
+ Hits 309851 309877 +26
- Misses 54121 54128 +7
- Partials 18315 18320 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Tested this against the repro from #24044, with a control on the parent commit so the result shows the fix flipping the behaviour rather than just passing on its own.
Rows delivered in a six second window from a source emitting one row per 100ms, so 59 is the expected full count. The middle column is the bug. The other two are unchanged across both commits: the first never had a repartition to coalesce, and the third already worked because Method: a single clone of this repo with the repro added as This resolves the issue as I reported it. |
Which issue does this PR close?
RepartitionExecwithholds all output from an unbounded input untilbatch_sizerows accumulate #24044.Rationale for this change
RepartitionExeccoalesces small batches on the producer side until the configured batch size is reached or all input senders finish. An unbounded input may never finish, so an available partial batch can be withheld indefinitely. This prevents an incremental query from emitting rows that are ready for downstream processing.What changes are included in this PR?
Are these changes tested?
Yes.
cargo fmt --all -- --checkcargo test -p datafusion-physical-plancargo clippy --all-targets --all-features -- -D warningsAGENTS.md, including all 503 sqllogictest filesThe regression test fails on the previous implementation because the partial batch is never emitted, and passes with this change. The existing bounded-input coalescing test also continues to pass.
Are there any user-facing changes?
Yes. Repartitioning an unbounded input can now emit partial batches promptly instead of waiting indefinitely to fill the configured batch size. This may expose smaller batches to downstream operators. There are no public API changes.