mbutrovich commented on code in PR #12347:
URL: https://github.com/apache/arrow-rs/pull/12347#discussion_r4653548087
##########
arrow-buffer/src/buffer/boolean.rs:
##########
@@ -620,6 +622,23 @@ impl BooleanBuffer {
BitSliceIterator::new(self.values(), self.bit_offset, self.bit_len)
}
+ /// Returns a [`SetBitCounter`] that counts the set bits before positions
in
+ /// this [`BooleanBuffer`]
+ ///
+ /// ```
+ /// # use arrow_buffer::BooleanBuffer;
+ /// // Validity of the elements of a list with rows of 3, 0, and 2 elements
+ /// let valid = BooleanBuffer::from(&[true, false, true, true, true][..]);
+ /// let mut counter = valid.set_bit_counter();
+ /// // Count the valid elements of each row, in row order
Review Comment:
> I recommend changing the example to be more generic about just counting
bits over sub ranges
Done. The example counts the set bits in ranges of a six-bit buffer, and
every example in the PR uses the same six bits.
--
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]