rluvaton commented on code in PR #23424:
URL: https://github.com/apache/datafusion/pull/23424#discussion_r3557457506
##########
datafusion/common/src/utils/mod.rs:
##########
@@ -1236,16 +1236,7 @@ pub fn adjust_offsets_for_slice<O: OffsetSizeTrait>(
) -> OffsetBuffer<O> {
let offsets = list.offsets();
- if let (Some(first), Some(last)) = (offsets.first(), offsets.last())
- && (!first.is_zero() || last.as_usize() != list.values().len())
- {
- let offsets = offsets.iter().map(|offset| *offset - *first).collect();
-
- //todo: use unsafe Offset::new_unchecked?
- return OffsetBuffer::new(offsets);
- }
-
- offsets.clone()
+ offsets.clone().subtract(offsets[0])
Review Comment:
Yes, I'm willing to sacrifice that in favor of avoiding copy and because
this was not guaranteed
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]