adriangb commented on code in PR #12185:
URL: https://github.com/apache/arrow-rs/pull/12185#discussion_r4540422209
##########
arrow-ipc/src/writer.rs:
##########
@@ -2353,32 +2353,46 @@ fn get_list_array_buffers<O: OffsetSizeTrait>(data:
&ArrayData) -> (Buffer, Arra
/// Returns the offsets, sizes, and child data buffers for a ListView array.
///
-/// Unlike List arrays, ListView arrays store both offsets and sizes
explicitly,
-/// and offsets can be non-monotonic. When slicing, we simply pass through the
-/// offsets and sizes without re-encoding, and do not slice the child data.
+/// The child data is narrowed to the range that the non-empty views of the
+/// slice reference, and the offsets are rebased to the start of that range.
+/// Views can overlap or be out of order, so the range runs from the smallest
+/// offset to the largest `offset + size`. Values inside the range that no view
+/// references are still written. Empty views get offset `0`, because their
+/// original offsets can lie outside the range.
fn get_list_view_array_buffers<O: OffsetSizeTrait>(
data: &ArrayData,
) -> (Buffer, Buffer, ArrayData) {
Review Comment:
A nice little refactor here would be a named struct especially since there's
multiple items in this tuple of the same type
--
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]