You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit acee931
Browse filesBrowse the repository at this point in the historyBrowse files
Two new metadata flags for the buffered_table contract, completing the
ordering-knob 2x2 over input (Sink) and output (Source) phases.
Meta.sink_order_dependent — when True (only meaningful with
buffered_table=True), the C++ Sink operator will declare
ParallelSink=false. All process() calls land on one worker in source
order; combine() sees a single state_id. Use when the function's
correctness depends on ingest order under a source that DuckDB might
otherwise parallelize.
Meta.requires_input_batch_index — when True (only meaningful with
buffered_table=True), the C++ Sink operator declares
RequiredPartitionInfo()=BatchIndex(). DuckDB threads a globally-unique
monotonic batch_index from the source into every Sink call; each
buffered_table_process RPC carries it through to params.batch_index on
the worker side. Workers can sort by batch_index in combine() to
reconstruct source order under parallel ingest. Requires a source that
supports batch_index (TEMP TABLE / parquet / CSV; range() / VALUES
don't, DuckDB rejects at scheduling time).
The two flags are mutually exclusive (single-thread sink already orders;
batch_index would be redundant noise) — rejected at metadata-resolve
time with a clear TypeError.
ProcessParams gains a `batch_index: int | None` field, populated only
when requires_input_batch_index=True. None for every other call path.
Two new fixtures exercise the flags:
- OrderedBufferInputFunction (sink_order_dependent=True)
- BatchIndexBufferInputFunction (requires_input_batch_index=True)
accumulates IndexedBatch(batch_index, batch_bytes) tuples, sorts in
combine(), yields in source order from finalize().
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments