Skip to content

Commit

Permalink
Suggest using arrow-provided utility for boolean unpacking
Browse files Browse the repository at this point in the history
  • Loading branch information
HadrienG2 committed May 14, 2024
1 parent f14bfbe commit acdb37d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arrow-array/src/builder/boolean_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ impl BooleanBuilder {

/// Returns the current values buffer as a slice
///
/// Boolean values are bit-packed into bytes, so to read the i-th boolean,
/// you must compute `values_slice[i / 8] & (1 << (i % 8)) == 0`.
/// Boolean values are bit-packed into bytes. To extract the i-th boolean
/// from the bytes, you can use `arrow_buffer::bit_util::get_bit()`.
pub fn values_slice(&self) -> &[u8] {
self.values_builder.as_slice()
}
Expand Down

0 comments on commit acdb37d

Please sign in to comment.