mapleFU commented on code in PR #8252:
URL: https://github.com/apache/arrow-rs/pull/8252#discussion_r2310924795
##########
arrow-array/src/array/list_array.rs:
##########
@@ -37,7 +37,9 @@ use std::sync::Arc;
/// [`LargeBinaryArray`]: crate::array::LargeBinaryArray
/// [`StringArray`]: crate::array::StringArray
/// [`LargeStringArray`]: crate::array::LargeStringArray
-pub trait OffsetSizeTrait: ArrowNativeType + std::ops::AddAssign + Integer {
+pub trait OffsetSizeTrait:
+ ArrowNativeType + std::ops::AddAssign + Integer + num::CheckedAdd
Review Comment:
I'm not so familiar with this so I don't know whether a `num::CheckedAdd`
okay
##########
arrow-array/src/builder/generic_bytes_builder.rs:
##########
@@ -162,6 +164,12 @@ impl<T: ByteArrayType> GenericByteBuilder<T> {
// and reserve the necessary capacity, it's still slower)
let mut intermediate = Vec::with_capacity(offsets.len() - 1);
+ if shift.checked_add(&offsets[offsets.len() - 1]).is_none() {
Review Comment:
This just check once using the last-offset
--
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]