tustvold commented on code in PR #3115:
URL: https://github.com/apache/arrow-rs/pull/3115#discussion_r1023563726
##########
arrow-array/src/builder/primitive_builder.rs:
##########
@@ -114,6 +115,26 @@ impl<T: ArrowPrimitiveType> PrimitiveBuilder<T> {
}
}
+ pub fn new_from_buffer(
+ values_buffer: MutableBuffer,
+ null_buffer: Option<MutableBuffer>,
+ ) -> Self {
+ let capacity = values_buffer.capacity();
+
+ let values_builder =
BufferBuilder::<T::Native>::new_from_buffer(values_buffer);
+
+ let null_buffer_builder = null_buffer
+ .map(|buffer| {
+ NullBufferBuilder::new_from_buffer(buffer,
values_builder.len(), capacity)
+ })
+ .unwrap_or_else(|| NullBufferBuilder::new(capacity));
Review Comment:
I don't think this is correct, I think it needs to be created with a length
of `values_builder.len()`, as opposed to a capacity based off values_buffer
--
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]