Skip to content

Commit

Permalink
fix: Stop producing empty row masks in chunked reader (#1429)
Browse files Browse the repository at this point in the history
  • Loading branch information
robert3005 authored Nov 21, 2024
1 parent 0d4e8a8 commit 6c2ec28
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vortex-file/src/read/buffered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ impl BufferedLayoutReader {
// TODO(robert): Support out of order reads
fn buffer_read(&mut self, mask: &RowMask) -> VortexResult<Option<Vec<MessageLocator>>> {
while let Some(((begin, end), layout)) = self.layouts.pop_front() {
if mask.end() > begin && mask.begin() <= end {
// Since ends are exclusive there's only overlap if either end is larger/smaller by at least 1
if mask.end() > begin && mask.begin() < end {
self.layouts.push_front(((begin, end), layout));
break;
}
}

while let Some(((begin, end), mut layout)) = self.layouts.pop_front() {
// This selection doesn't know about rows in this chunk, we should put it back and wait for another request with different range
if mask.end() <= begin || mask.begin() > end {
if mask.end() <= begin || mask.begin() >= end {
self.layouts.push_front(((begin, end), layout));
return Ok(None);
}
Expand Down

0 comments on commit 6c2ec28

Please sign in to comment.