Skip to content

Commit 688a814

Browse files
committed
docs
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
1 parent 97c1aa9 commit 688a814

4 files changed

Lines changed: 10 additions & 9 deletions

File tree

vortex-layout/src/scan/layout.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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,

vortex-layout/src/scan/limit.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ use vortex_array::ArrayRef;
1616
use vortex_error::VortexExpect;
1717
use 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)]
2626
pub(crate) struct SharedRowLimit(Arc<AtomicU64>);
2727

vortex-layout/src/scan/multi.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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,

vortex-layout/src/scan/repeated_scan.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)