Skip to content

Commit

Permalink
parquet: Use constant for RLE decoder buffer size (#1070)
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Dec 22, 2021
1 parent 2b5c53e commit 94c0999
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit 94c0999

Please sign in to comment.