You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/04 20:02:46 UTC

[GitHub] [arrow-rs] alamb commented on a diff in pull request #1517: Fix get_arrow_field for List

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


##########
parquet/src/arrow/array_reader/builder.rs:
##########
@@ -698,7 +700,12 @@ impl<'a> ArrayReaderBuilder {
                         ArrowType::Struct(fields) => {
                             field = fields.iter().find(|f| f.name() == part)
                         }
-                        ArrowType::List(list_field) => field = Some(list_field.as_ref()),
+                        ArrowType::List(list_field) => match list_field.data_type() {
+                            ArrowType::Struct(fields) => {
+                                field = fields.iter().find(|f| f.name() == part)
+                            }
+                            _ => field = Some(list_field.as_ref()),
+                        },

Review Comment:
   I think ideally we would construct a parquet file with this pattern programmatically (aka write it out in a test and then read it back in). 
   
   if that is not possible / feasible, adding an example in parquet-testing would be second best



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org