adriangb commented on code in PR #15057:
URL: https://github.com/apache/datafusion/pull/15057#discussion_r2178912618


##########
datafusion/datasource-parquet/src/opener.rs:
##########
@@ -252,16 +257,20 @@ impl FileOpener for ParquetOpener {
             // This evaluates missing columns and inserts any necessary casts.
             let predicate = predicate
                 .map(|p| {
-                    PhysicalExprSchemaRewriter::new(
+                    let mut rewriter = PhysicalExprSchemaRewriter::new(
                         &physical_file_schema,
                         &logical_file_schema,
                     )
                     .with_partition_columns(
                         partition_fields.to_vec(),
                         file.partition_values,
-                    )
-                    .rewrite(p)
-                    .map_err(ArrowError::from)
+                    );
+                    if let Some(predicate_rewrite_hook) = 
predicate_rewrite_hook.as_ref()
+                    {
+                        rewriter = rewriter
+                            
.with_rewrite_hook(Arc::clone(predicate_rewrite_hook));
+                    };
+                    rewriter.rewrite(p).map_err(ArrowError::from)

Review Comment:
   I'm thinking maybe these should be decoupled and it just becomes two 
different rewrite passes.



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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to