alamb commented on code in PR #3157:
URL: https://github.com/apache/arrow-rs/pull/3157#discussion_r1029374811


##########
arrow-data/src/transform/utils.rs:
##########
@@ -36,7 +36,7 @@ pub(super) fn extend_offsets<T: ArrowNativeType + Integer>(
     offsets.windows(2).for_each(|offsets| {
         // compute the new offset
         let length = offsets[1] - offsets[0];
-        last_offset = last_offset + length;
+        last_offset = last_offset.checked_add(&length).expect("offset 
overflow");

Review Comment:
   I wonder if we could leave a breadcrumb here if someone else hits it -- like 
mabye
   
   ```suggestion
           // if you hit this appending to a StringArray / BinaryArray it is 
because you
           // are trying to add more data than can fit into that type. Try 
breaking your data into
           // smaller batches or using LargeStringArray / LargeBinaryArray
           last_offset = last_offset.checked_add(&length).expect("offset 
overflow");
   ```



-- 
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