File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -335,6 +335,8 @@ impl Partition for LayoutReaderSplit {
335335 // Use into_stream() which creates a LazyScanStream that spawns individual I/O
336336 // tasks onto the runtime, enabling parallel execution across executor threads.
337337 let stream = builder. into_stream ( ) ?. boxed ( ) ;
338+ // Caps total rows across all partitions; only correct for unordered consumption
339+ // (see `SharedRowLimit`).
338340 let stream = match shared_limit {
339341 Some ( limit) => LimitedStream :: new ( stream, RowBudget :: Shared ( limit) ) . boxed ( ) ,
340342 None => stream,
Original file line number Diff line number Diff line change @@ -16,12 +16,12 @@ use vortex_array::ArrayRef;
1616use vortex_error:: VortexExpect ;
1717use vortex_error:: VortexResult ;
1818
19- /// A row limit shared by streams that execute independent scan partitions.
19+ /// A row limit shared by the streams executing one scan's independent partitions.
2020///
21- /// The shared budget gives "at most `limit` rows in total" semantics without any ordering
22- /// guarantee across the streams that share it: whichever stream produces a chunk first claims
23- /// the budget first. It is therefore only correct for consumers that treat the combined output
24- /// as unordered (e.g. a bare `LIMIT n`), not for order-preserving cross -partition consumption .
21+ /// The single budget is claimed in completion order, not row order, so the combined output is
22+ /// "any `limit` rows", not " the first `limit` in scan order": under concurrency a later partition
23+ /// can drain the budget and starve an earlier one. Only sound for unordered consumers (a bare
24+ /// `LIMIT n`); order-preserving consumers must use a per -partition `ScanBuilder::with_limit` .
2525#[ derive( Clone ) ]
2626pub ( crate ) struct SharedRowLimit ( Arc < AtomicU64 > ) ;
2727
Original file line number Diff line number Diff line change @@ -542,6 +542,8 @@ impl Partition for MultiLayoutPartition {
542542
543543 let dtype = builder. dtype ( ) ?;
544544 let stream = builder. into_stream ( ) ?. boxed ( ) ;
545+ // Caps total rows across all partitions; only correct for unordered consumption
546+ // (see `SharedRowLimit`).
545547 let stream = match shared_limit {
546548 Some ( limit) => LimitedStream :: new ( stream, RowBudget :: Shared ( limit) ) . boxed ( ) ,
547549 None => stream,
Original file line number Diff line number Diff line change @@ -183,10 +183,7 @@ impl RepeatedScan {
183183 } )
184184 }
185185
186- pub ( crate ) fn execute (
187- & self ,
188- row_range : Option < Range < u64 > > ,
189- ) -> VortexResult < Vec < TaskFuture > > {
186+ pub ( crate ) fn execute ( & self , row_range : Option < Range < u64 > > ) -> VortexResult < Vec < TaskFuture > > {
190187 let ctx = self . task_context ( ) ;
191188
192189 let mut limit = self . limit ;
You can’t perform that action at this time.
0 commit comments