Skip to content

Commit

Permalink
fix(row selection): off-by-one error
Browse files Browse the repository at this point in the history
  • Loading branch information
sdd committed Aug 16, 2024
1 parent 8f74869 commit 1ec6d9a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/iceberg/src/arrow/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,6 @@ impl ArrowReader {
// skip row groups that aren't present in selected_row_groups
if idx == selected_row_groups[selected_row_groups_idx] {
selected_row_groups_idx += 1;
if selected_row_groups_idx == selected_row_groups.len() {
break;
}
} else {
continue;
}
Expand All @@ -459,6 +456,12 @@ impl ArrowReader {
)?;

results.push(selections_for_page);

if let Some(selected_row_groups) = selected_row_groups {
if selected_row_groups_idx == selected_row_groups.len() {
break;
}
}
}

Ok(results.into_iter().flatten().collect::<Vec<_>>().into())
Expand Down

0 comments on commit 1ec6d9a

Please sign in to comment.