mapleFU commented on code in PR #8252:
URL: https://github.com/apache/arrow-rs/pull/8252#discussion_r2310946778


##########
arrow-array/src/builder/generic_bytes_builder.rs:
##########
@@ -142,9 +143,10 @@ impl<T: ByteArrayType> GenericByteBuilder<T> {
     /// Appends array values and null to this builder as is
     /// (this means that underlying null values are copied as is).
     #[inline]
-    pub fn append_array(&mut self, array: &GenericByteArray<T>) {
+    pub fn append_array(&mut self, array: &GenericByteArray<T>) -> Result<(), 
ArrowError> {

Review Comment:
   Note:
   
   ```
   // Shifting all the offsets
               let shift: T::Offset = self.next_offset() - offsets[0];
   ```
   
   The `self.next_offset()` would read the length of binary builder, if:
   1. There're k batches, and the batch before `k`th batch exceeds the offsets, 
when merge next array, `self.next_offset()` would raise error, causing a 
`expect` called in `self.next_offset()`
   2. If final batch exceeds, it would leaving overflow offsets in 
`intermediate`



-- 
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-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to