You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/09/11 06:32:23 UTC
[GitHub] [arrow-rs] tustvold commented on a diff in pull request #2699: Clarify docs of binary and string builders
tustvold commented on code in PR #2699:
URL: https://github.com/apache/arrow-rs/pull/2699#discussion_r967767856
##########
arrow/src/array/builder/generic_string_builder.rs:
##########
@@ -28,16 +28,17 @@ pub struct GenericStringBuilder<OffsetSize: OffsetSizeTrait> {
}
impl<OffsetSize: OffsetSizeTrait> GenericStringBuilder<OffsetSize> {
- /// Creates a new [`GenericStringBuilder`],
+ /// Creates a new [`GenericStringBuilder`].
pub fn new() -> Self {
Self {
builder: GenericBinaryBuilder::new(),
}
}
- /// Creates a new [`GenericStringBuilder`],
- /// `data_capacity` is the number of bytes of string data to pre-allocate space for in this builder
- /// `item_capacity` is the number of items to pre-allocate space for in this builder
+ /// Creates a new [`GenericStringBuilder`].
+ ///
+ /// - `item_capacity` is the number of items to pre-allocate (the size of the buffer of offsets).
Review Comment:
```suggestion
/// - `item_capacity` is the number of items to pre-allocate (i.e. the final length of the array).
```
Or something, the offsets is actually one larger than this 😅
##########
arrow/src/array/builder/generic_binary_builder.rs:
##########
@@ -38,9 +38,10 @@ impl<OffsetSize: OffsetSizeTrait> GenericBinaryBuilder<OffsetSize> {
Self::with_capacity(1024, 1024)
}
- /// Creates a new [`GenericBinaryBuilder`],
- /// `item_capacity` is the number of items to pre-allocate space for in this builder
- /// `data_capacity` is the number of bytes to pre-allocate space for in this builder
+ /// Creates a new [`GenericBinaryBuilder`].
+ ///
+ /// - `item_capacity` is the number of items to pre-allocate (the size of the buffer of offsets).
Review Comment:
```suggestion
/// - `item_capacity` is the number of items to pre-allocate (i.e. the final length of the array).
```
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org