kylebarron commented on code in PR #7365:
URL: https://github.com/apache/arrow-rs/pull/7365#discussion_r2021851051


##########
parquet/src/arrow/arrow_reader/statistics.rs:
##########
@@ -1290,32 +1290,69 @@ impl<'a> StatisticsConverter<'a> {
     ///
     /// * If the column is not found in the arrow schema
     pub fn try_new<'b>(
-        column_name: &'b str,
+        column: &'b ColumnPath,
         arrow_schema: &'a Schema,
         parquet_schema: &'a SchemaDescriptor,
     ) -> Result<Self> {
+        let mut fields = arrow_schema.fields();
+
+        let mut arrow_field = None;
         // ensure the requested column is in the arrow schema
-        let Some((_idx, arrow_field)) = 
arrow_schema.column_with_name(column_name) else {
+        for part in column.parts() {
+            if let Some((_idx, inner_arrow_field)) = fields.find(part) {
+                match inner_arrow_field.data_type() {
+                    DataType::Struct(inner_fields) => {
+                        fields = inner_fields;
+                    }
+                    _ => {
+                        arrow_field = Some(inner_arrow_field);
+                    }
+                }

Review Comment:
   The core change: recursively look into the arrow field's children if the 
field is a struct



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

Reply via email to