kosiew commented on code in PR #23217:
URL: https://github.com/apache/datafusion/pull/23217#discussion_r3490783631


##########
datafusion/datasource-parquet/src/row_filter.rs:
##########
@@ -830,11 +963,11 @@ fn build_filter_schema(
                 return Arc::new(field.clone());
             }
 
-            let Some(field_paths) = paths_by_root.get(&idx) else {
+            let Some(node) = access_tree.root(idx) else {
                 return Arc::new(field.clone());
             };
 
-            let pruned_data_type = prune_struct_type(field.data_type(), 
field_paths);
+            let pruned_data_type = prune_struct_type(field.data_type(), node);
             Arc::new(Field::new(

Review Comment:
   Small future cleanup suggestion: if this internal projected schema is 
expected to preserve wrapper field metadata for pruned structs, it might be 
worth copying the metadata when rebuilding the root and intermediate `Field`s 
here and in `prune_struct_type`.
   
   I don't think this PR introduces the issue, and it probably is not scan 
output visible since the terminal fields are cloned and the decoder projection 
can restore the requested output schema. This is mostly a future proofing and 
test coverage suggestion.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to