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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to