You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by dh...@apache.org on 2021/12/21 11:53:00 UTC

[arrow-rs] branch master updated: parquet: Use constant for RLE decoder buffer size (#1070)

This is an automated email from the ASF dual-hosted git repository.

dheres pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/master by this push:
     new 5a32391  parquet: Use constant for RLE decoder buffer size (#1070)
5a32391 is described below

commit 5a323915f6c5f53605b82b29c3867252036efe90
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Tue Dec 21 06:52:56 2021 -0500

    parquet: Use constant for RLE decoder buffer size (#1070)
---
 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,