diff --git a/parquet/src/column/reader.rs b/parquet/src/column/reader.rs index b40ca2b78291..87e9f507a985 100644 --- a/parquet/src/column/reader.rs +++ b/parquet/src/column/reader.rs @@ -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