Skip to content

Commit

Permalink
check the number of rep levels read from page
Browse files Browse the repository at this point in the history
  • Loading branch information
jp0317 committed Aug 13, 2024
1 parent a693f0f commit 2f2245c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions parquet/src/column/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ where
let (mut records_read, levels_read) =
reader.read_rep_levels(out, remaining_records, remaining_levels)?;

if levels_read == 0 {
// Tha fact that we're still looping implies there must be some levels to read.
return Err(general_err!("Insufficient repetition levels read from column"));
}
if levels_read == remaining_levels && self.has_record_delimiter {
// Reached end of page, which implies records_read < remaining_records
// as otherwise would have stopped reading before reaching the end
Expand Down

0 comments on commit 2f2245c

Please sign in to comment.