Skip to content

Commit

Permalink
Don't panic on RleValueEncoder::flush_buffer if empty (#2558) (#2559)
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed Aug 23, 2022
1 parent ad84176 commit f11fc1f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions parquet/src/arrow/arrow_reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,10 @@ mod tests {
TestOptions::new(2, 256, 91)
.with_null_percent(25)
.with_enabled_statistics(EnabledStatistics::None),
// Test with all null
TestOptions::new(2, 128, 91)
.with_null_percent(100)
.with_enabled_statistics(EnabledStatistics::None),
// Test skip

// choose record_batch_batch (15) so batches cross row
Expand Down
2 changes: 1 addition & 1 deletion parquet/src/encodings/encoding/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ impl<T: DataType> Encoder<T> for RleValueEncoder<T> {

// Flush all encoder buffers and raw values
let mut buf = rle_encoder.consume();
assert!(buf.len() > 4, "should have had padding inserted");
assert!(buf.len() >= 4, "should have had padding inserted");

// Note that buf does not have any offset, all data is encoded bytes
let len = (buf.len() - 4) as i32;
Expand Down

0 comments on commit f11fc1f

Please sign in to comment.