tustvold commented on code in PR #6893: URL: https://github.com/apache/arrow-rs/pull/6893#discussion_r1889284118
########## arrow-buffer/src/buffer/offset.rs: ########## @@ -162,6 +163,44 @@ impl<O: ArrowNativeType> OffsetBuffer<O> { } } +impl<O: ArrowNativeType + Integer + Copy> OffsetBuffer<O> { Review Comment: Perhaps instead of this we could just add ``` pub fn lengths(&self) -> impl Iterator<Item=usize> { self.0.windows(2).map(|x| x[1].as_usize() - x[0].as_usize()) } ``` Then you'd be able to merge using ``` OffsetBuffer::from_lengths(iter.flat_map(|x| x.lengths())) ``` -- 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