HippoBaro commented on code in PR #9653:
URL: https://github.com/apache/arrow-rs/pull/9653#discussion_r3054298913
##########
parquet/src/encodings/rle.rs:
##########
@@ -122,6 +122,27 @@ impl RleEncoder {
bit_packed_max_size.max(rle_max_size)
}
+ /// Returns `true` if the encoder is currently in RLE accumulation mode
+ /// for the given value (i.e., `repeat_count > 8` and `current_value ==
value`).
+ ///
+ /// When this returns `true`, callers may use
[`extend_run`](Self::extend_run)
+ /// to add more repetitions without per-element overhead.
+ #[inline]
+ pub fn is_accumulating(&self, value: u64) -> bool {
+ self.repeat_count > 8 && self.current_value == value
Review Comment:
Also, c891c35848f530909bda363aeccef0e01e8b6c68 introduces a new constant
`BIT_PACK_GROUP_SIZE` as requested, and also swaps the leftover literals which
referred to the count of bits in a byte with `u8::BITS` from the std as needed.
##########
parquet/src/encodings/rle.rs:
##########
@@ -122,6 +122,27 @@ impl RleEncoder {
bit_packed_max_size.max(rle_max_size)
}
+ /// Returns `true` if the encoder is currently in RLE accumulation mode
+ /// for the given value (i.e., `repeat_count > 8` and `current_value ==
value`).
+ ///
+ /// When this returns `true`, callers may use
[`extend_run`](Self::extend_run)
+ /// to add more repetitions without per-element overhead.
+ #[inline]
+ pub fn is_accumulating(&self, value: u64) -> bool {
+ self.repeat_count > 8 && self.current_value == value
Review Comment:
Also, c891c35848f530909bda363aeccef0e01e8b6c68 introduces a new constant
`BIT_PACK_GROUP_SIZE` as requested, and also swaps the leftover literals which
referred to the count of bits in a byte with `u8::BITS` from the std.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]