Jefffrey commented on code in PR #10172:
URL: https://github.com/apache/arrow-rs/pull/10172#discussion_r3456819931


##########
parquet/src/util/bit_util.rs:
##########
@@ -52,17 +50,29 @@ pub unsafe trait FromBytes: Sized {
 /// directly converted from a u64 value. Types like Int96, ByteArray,
 /// and FixedLenByteArray that cannot be represented in 64 bits do not
 /// implement this trait.
-pub trait FromBitpacked: FromBytes {
+pub trait FromBitpacked {
+    /// The maximum number of bits that are allowed to be converted to this 
type.
+    /// This is at most the size of the type in bits, but could be less, for 
example
+    /// for the boolean type.
+    const BIT_CAPACITY: usize;
+    /// How many values are converted by one call to `unpack_batch`.
+    const BATCH_SIZE: usize;
     /// Convert directly from a u64 value by truncation, avoiding byte slice 
copies.
     fn from_u64(v: u64) -> Self;
+
+    /// Converts multiple bitpacked values from `input` to `output`.
+    /// The `output` slice needs to have space for at least `BATCH_SIZE` 
elements,
+    /// otherwise this method will panic.
+    fn unpack_batch(input: &[u8], output: &mut [Self], num_bits: usize)
+    where
+        Self: Sized;
 }
 
 macro_rules! from_le_bytes {
     ($($ty: ty),*) => {
         $(
         // SAFETY: this macro is used for types for which all bit patterns are 
valid.

Review Comment:
   ```suggestion
   ```



-- 
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]

Reply via email to