HaoYang670 commented on code in PR #2592:
URL: https://github.com/apache/arrow-rs/pull/2592#discussion_r956534869
##########
arrow/src/array/builder/generic_binary_builder.rs:
##########
@@ -34,15 +34,8 @@ pub struct GenericBinaryBuilder<OffsetSize: OffsetSizeTrait>
{
impl<OffsetSize: OffsetSizeTrait> GenericBinaryBuilder<OffsetSize> {
/// Creates a new [`GenericBinaryBuilder`].
- /// `capacity` is the number of bytes in the values array.
- pub fn new(capacity: usize) -> Self {
- let mut offsets_builder = BufferBuilder::<OffsetSize>::new(1024);
- offsets_builder.append(OffsetSize::zero());
- Self {
- value_builder: UInt8BufferBuilder::new(capacity),
- offsets_builder,
- null_buffer_builder: NullBufferBuilder::new(1024),
- }
+ pub fn new() -> Self {
+ Self::with_capacity(1024, 1024)
Review Comment:
Is it a reasonable assumption that the array contains the same number of
elements and bytes?
--
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]