You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/07/12 02:49:59 UTC
[GitHub] [arrow-rs] tustvold commented on a diff in pull request #4509: feat: `builder` method for GenericByteArray
tustvold commented on code in PR #4509:
URL: https://github.com/apache/arrow-rs/pull/4509#discussion_r1260501026
##########
arrow-array/src/builder/generic_bytes_builder.rs:
##########
@@ -150,6 +190,11 @@ impl<T: ByteArrayType> GenericByteBuilder<T> {
self.value_builder.as_slice()
}
+ /// Returns the current values buffer as a mutable slice
+ pub fn values_slice_mut(&mut self) -> &mut [u8] {
Review Comment:
This is unsound as it would permit creating non UTF-8 data
##########
arrow-array/src/builder/generic_bytes_builder.rs:
##########
@@ -109,13 +109,53 @@ impl<T: ByteArrayType> GenericByteBuilder<T> {
};
}
+ /// Appends a value into the builder.
+ ///
+ /// # Panics
+ ///
+ /// Panics if the resulting length of [`Self::values_slice`] would exceed `T::Offset::MAX`
+ #[inline]
+ pub fn append_slice(&mut self, values: &[impl AsRef<T::Native>]) {
Review Comment:
What is the rationale for these methods over the existing Extend support
--
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