alamb commented on code in PR #8996:
URL: https://github.com/apache/arrow-rs/pull/8996#discussion_r2620280204


##########
arrow-buffer/src/buffer/boolean.rs:
##########
@@ -96,12 +96,128 @@ impl BooleanBuffer {
         Self::new(buffer.into(), 0, len)
     }
 
+    /// Create a new [`BooleanBuffer`] by copying the relevant bits from an
+    /// input buffer.
+    ///
+    /// # Notes:
+    /// * The new `BooleanBuffer` has zero offset
+    ///
+    /// # Example: Create a new [`BooleanBuffer`] copying a bit slice from in 
input slice
+    /// ```
+    /// # use arrow_buffer::BooleanBuffer;
+    /// let input = [0b11001100u8, 0b10111010u8];
+    /// // // Copy bits 4..16 from input
+    /// let result = BooleanBuffer::from_bits(&input, 4, 12);
+    /// assert_eq!(result.values(), &[0b10101100u8, 0b00001011u8]);
+    pub fn from_bits(left: impl AsRef<[u8]>, offset_in_bits: usize, 
len_in_bits: usize) -> Self {

Review Comment:
   This is a good call -- the left/right naming is related to the fact there is 
a binary version of this kernel (where left/right does make sense). I think src 
is better. Will fix



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