Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't panic on RleValueEncoder::flush_buffer if empty (#2558) #2559

Merged
merged 1 commit into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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