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

parquet: Use constant for RLE decoder buffer size #1070

Merged
merged 1 commit into from
Dec 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion parquet/src/encodings/rle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ impl RleEncoder {
}
}

/// Size, in number of `i32s` of buffer to use for RLE batch reading
const RLE_DECODER_INDEX_BUFFER_SIZE: usize = 1024;

/// A RLE/Bit-Packing hybrid decoder.
pub struct RleDecoder {
// Number of bits used to encode the value. Must be between [0, 64].
Expand All @@ -319,7 +322,7 @@ pub struct RleDecoder {
bit_reader: Option<BitReader>,

// Buffer used when `bit_reader` is not `None`, for batch reading.
index_buf: Option<Box<[i32; 1024]>>,
index_buf: Option<Box<[i32; RLE_DECODER_INDEX_BUFFER_SIZE]>>,

// The remaining number of values in RLE for this run
rle_left: u32,
Expand Down