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


##########
arrow-array/src/array/struct_array.rs:
##########
@@ -294,10 +294,19 @@ impl StructArray {
 
 impl From<ArrayData> for StructArray {
     fn from(data: ArrayData) -> Self {
+        let parent_offset = data.offset();
+        let parent_len = data.len();
+
         let fields = data
             .child_data()
             .iter()
-            .map(|cd| make_array(cd.clone()))
+            .map(|cd| {
+                if parent_offset != 0 || cd.len() != parent_len {

Review Comment:
   What is the rationale for `cd.len() != parent_len`?
   
   It seems like the only condition for slicing the child should be that the 
parent has an offset 🤔 
   
   When I changed it to only look at offset, the tests all still pass so that 
suggests to me it isn't covered 🤔 
   
   ```suggestion
                   if parent_offset != 0 {
   ```



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