jhorstmann commented on code in PR #4507:
URL: https://github.com/apache/arrow-rs/pull/4507#discussion_r1264647337
##########
arrow-array/src/array/boolean_array.rs:
##########
@@ -246,6 +246,62 @@ impl BooleanArray {
});
Self::new(values, nulls)
}
+
+ /// Returns `BooleanBuilder` of this boolean array for mutating its values
if the underlying
+ /// data buffer is not shared by others.
+ pub fn into_builder(self) -> Result<BooleanBuilder, Self> {
+ let len = self.len();
+ let data = self.into_data();
+ let null_bit_buffer = data.nulls().map(|b| b.inner().sliced());
+
+ let buffer = data.buffers()[0].slice_with_length(data.offset(), (len +
7) / 8);
Review Comment:
I think this would slice the buffer using byte offsets instead of bit
offsets. You could look into the `Buffer::bit_slice` method or try to use
`BooleanArray::slices` directly, without converting to `ArrayData` first.
--
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]