Skip to content

Commit f187a2e

Browse files
committed
filter out 0 ranges
Signed-off-by: Onur Satici <onur@spiraldb.com>
1 parent fef8e09 commit f187a2e

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

vortex-scan/src/lib.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,16 @@ impl<A: 'static + Send> RepeatedScan<A> {
354354
let row_range = intersect_ranges(self.row_range.as_ref(), row_range);
355355
let splits_iter: Box<dyn Iterator<Item = _>> = match row_range {
356356
None => Box::new(self.splits.iter().copied()),
357-
Some(range) => Box::new(
358-
iter::once(range.start)
359-
.chain(self.splits.range(range.clone()).copied())
360-
.chain(iter::once(range.end)),
361-
),
357+
Some(range) => {
358+
if range.start > range.end {
359+
return Ok(Vec::new());
360+
}
361+
Box::new(
362+
iter::once(range.start)
363+
.chain(self.splits.range(range.clone()).copied())
364+
.chain(iter::once(range.end)),
365+
)
366+
}
362367
};
363368

364369
// Create a task that executes the full scan pipeline for each split.

0 commit comments

Comments
 (0)