alamb commented on code in PR #7705:
URL: https://github.com/apache/arrow-rs/pull/7705#discussion_r2165034359
##########
arrow-row/src/list.rs:
##########
@@ -184,3 +184,123 @@ pub unsafe fn decode<O: OffsetSizeTrait>(
Ok(GenericListArray::from(unsafe { builder.build_unchecked() }))
}
+
+pub fn compute_lengths_fixed_size_list(
+ tracker: &mut LengthTracker,
Review Comment:
Just pattern matching, I wonder why this doesn't use the [same pattern as
`List`](https://github.com/apache/arrow-rs/blob/667cbdf65c66bf36c5e6d2d055f5daf8d62c4afc/arrow-row/src/list.rs#L25-L28)?
Why not
```suggestion
lengths: &mut [usize],
```
(I don't see anything wrong with this I am just curious)
##########
arrow-row/src/lib.rs:
##########
@@ -2205,11 +2231,12 @@ mod tests {
let rows = converter.convert_columns(&[Arc::clone(&list)]).unwrap();
assert!(rows.row(0) > rows.row(1)); // [32, 52, 32] > [32, 52, 12]
- assert!(rows.row(2) < rows.row(1)); // [32, 42] < [32, 52, 12]
- assert!(rows.row(3) < rows.row(2)); // null < [32, 42]
- assert!(rows.row(4) < rows.row(2)); // [32, null] < [32, 42]
- assert!(rows.row(5) < rows.row(2)); // [] < [32, 42]
+ assert!(rows.row(2) < rows.row(1)); // [32, 52] < [32, 52, 12]
Review Comment:
👍
##########
arrow-row/src/list.rs:
##########
@@ -184,3 +184,123 @@ pub unsafe fn decode<O: OffsetSizeTrait>(
Ok(GenericListArray::from(unsafe { builder.build_unchecked() }))
}
+
+pub fn compute_lengths_fixed_size_list(
Review Comment:
Could you please also update the documentation here for the encoding:
-
https://github.com/apache/arrow-rs/blob/667cbdf65c66bf36c5e6d2d055f5daf8d62c4afc/arrow-row/src/lib.rs#L308-L307
I think maybe we could just say that FixedSizedLists use the same encoding
scheme as Lists
--
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]