alamb commented on code in PR #7996:
URL: https://github.com/apache/arrow-rs/pull/7996#discussion_r2232882189


##########
arrow-row/src/lib.rs:
##########
@@ -518,12 +518,33 @@ impl Codec {
             }
             Codec::List(converter) => {
                 let values = match array.data_type() {
-                    DataType::List(_) => as_list_array(array).values(),
-                    DataType::LargeList(_) => 
as_large_list_array(array).values(),
-                    DataType::FixedSizeList(_, _) => 
as_fixed_size_list_array(array).values(),
+                    DataType::List(_) => {
+                        let list_array = as_list_array(array);
+                        let first_offset = list_array.offsets()[0] as usize;
+                        let last_offset =
+                            list_array.offsets()[list_array.offsets().len() - 
1] as usize;
+
+                        list_array
+                            .values()
+                            .slice(first_offset, last_offset - first_offset)

Review Comment:
   Could you also please add some comments explaining the context of this code 
(that as you have said, is non obvious) for future readers
   
   For example, something like
   ```rust
   // values can include more data than referenced in the ListArray, only encode
   // the referenced values. 



-- 
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

Reply via email to