gitmodimo opened a new pull request, #51141: URL: https://github.com/apache/arrow/pull/51141
### Rationale for this change SortedMerge uses a dedicated worker thread and assumes input batches arrive in logical order. This prevents safe threaded execution and leaves backpressure, completion, stopping, and error propagation split across separate execution paths. The earlier implementation in #47394 added per-input sequencing and backpressure while retaining the existing worker thread; this PR is a new version that addresses #47393 with a single executor-managed implementation. ### What changes are included in this PR? - Replace the worker thread, process queue, and poison-pill shutdown with one executor-managed merge flow. Per-input `SerialSequencingQueue`s restore logical `ExecBatch::index` order for threaded, serial, and compile-time no-thread builds. - Add bounded upstream backpressure and downstream pause/resume handling. Completion flushes buffered rows, stopping propagates upstream, and sink-driven resume cannot race scheduler teardown. - Select multi-row runs up to the earliest row visible on another input, allowing one selection to span multiple timestamps. Runs retain their original `ExecBatch` payloads until direct materialization with Arrow builders. This supports scalar payloads and bypasses Boolean slices with non-zero offsets reported in #48072. - Validate ascending input order and propagate validation, materialization, and downstream errors through normal ExecPlan status handling. ### Are these changes tested? Yes. All tests pass in threaded and `ARROW_ENABLE_THREADING=OFF` builds. Coverage includes signed keys crossing zero, scalar payloads, deterministic sequencing under jittered delivery, and downstream backpressure, resume, and stop. ### Are there any user-facing changes? SortedMerge now supports concurrent input delivery, upstream and downstream backpressure, scalar payloads. Inputs that violate their declared ascending order return an `Invalid` status. No API changes. -- 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]
