samueleresca commented on code in PR #8594:
URL: https://github.com/apache/arrow-rs/pull/8594#discussion_r2436714593
##########
arrow-array/src/builder/generic_bytes_view_builder.rs:
##########
@@ -356,17 +371,41 @@ impl<T: ByteViewType + ?Sized> GenericByteViewBuilder<T> {
let to_reserve = v.len().max(self.block_size.next_size() as usize);
self.in_progress.reserve(to_reserve);
};
- let offset = self.in_progress.len() as u32;
+ let offset: u32 = self.in_progress.len().try_into().map_err(|_| {
+ ArrowError::InvalidArgumentError(format!(
+ "In-progress buffer length {} exceeds u32::MAX",
Review Comment:
> To error here, we would need a usize that doesn't fit into a u32.. I think
all platforms we care about have usize that is at least u32 (aka 32-bit
architectures)
I think that would be the opposite, a `usize` in a 64-bit arch wouldn't fit
a u32? Anyway, I will review and update these changes over the weekend
--
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]