This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch active_release
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/active_release by this push:
new bd3600b parquet: Use constant for RLE decoder buffer size (#1070)
(#1088)
bd3600b is described below
commit bd3600b6483c253ae57a38928a636d39a6b7cb02
Author: Andrew Lamb <[email protected]>
AuthorDate: Wed Dec 22 15:49:08 2021 -0500
parquet: Use constant for RLE decoder buffer size (#1070) (#1088)
---
parquet/src/encodings/rle.rs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/parquet/src/encodings/rle.rs b/parquet/src/encodings/rle.rs
index 02a6034..f61215f 100644
--- a/parquet/src/encodings/rle.rs
+++ b/parquet/src/encodings/rle.rs
@@ -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].
@@ -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,