klion26 commented on code in PR #8768:
URL: https://github.com/apache/arrow-rs/pull/8768#discussion_r2502008063
##########
arrow-array/src/builder/generic_bytes_builder.rs:
##########
@@ -392,6 +392,50 @@ impl<O: OffsetSizeTrait> StringLikeArrayBuilder for
GenericStringBuilder<O> {
}
}
+/// A byte size value representing the number of bytes to allocate per binary
in [`GenericBinaryBuilder`]
+///
+/// To create a [`GenericBinaryBuilder`] using `.with_capacity` we are
required to provide: \
+/// - `item_capacity` - the row count \
+/// - `data_capacity` - total binary byte count \
+///
+/// We will use the `AVERAGE_BINARY_LENGTH` * row_count for `data_capacity`. \
+///
+/// These capacities are preallocation hints used to improve performance,
+/// but consequences of passing a hint too large or too small should be
negligible.
+const AVERAGE_BINARY_LENGTH: usize = 128;
Review Comment:
Use 128 as the average length, I think binary may used to store blobs, and
16(the average size for string) may not enough, can change this number if
needed.
--
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]