jayzhan211 commented on code in PR #15685: URL: https://github.com/apache/datafusion/pull/15685#discussion_r2040471645
########## datafusion/physical-expr/src/expressions/dynamic_filters.rs: ########## @@ -335,22 +313,12 @@ mod test { ])); // Each ParquetExec calls `with_new_children` on the DynamicFilterPhysicalExpr // and remaps the children to the file schema. - let dynamic_filter_1 = reassign_predicate_columns( - Arc::clone(&dynamic_filter) as Arc<dyn PhysicalExpr>, - &filter_schema_1, - false, - ) - .unwrap(); - let snap = dynamic_filter_1.snapshot().unwrap().unwrap(); - insta::assert_snapshot!(format!("{snap:?}"), @r#"BinaryExpr { left: Column { name: "a", index: 0 }, op: Eq, right: Literal { value: Int32(42) }, fail_on_overflow: false }"#); - let dynamic_filter_2 = reassign_predicate_columns( - Arc::clone(&dynamic_filter) as Arc<dyn PhysicalExpr>, - &filter_schema_2, - false, - ) - .unwrap(); - let snap = dynamic_filter_2.snapshot().unwrap().unwrap(); - insta::assert_snapshot!(format!("{snap:?}"), @r#"BinaryExpr { left: Column { name: "a", index: 1 }, op: Eq, right: Literal { value: Int32(42) }, fail_on_overflow: false }"#); + let dynamic_filter_1 = dynamic_filter.with_schema(Arc::clone(&filter_schema_1)); + let snap_1 = dynamic_filter_1.snapshot().unwrap().unwrap(); + insta::assert_snapshot!(format!("{snap_1:?}"), @r#"BinaryExpr { left: Column { name: "a", index: 0 }, op: Eq, right: Literal { value: Int32(42) }, fail_on_overflow: false }"#); + let dynamic_filter_2 = dynamic_filter.with_schema(Arc::clone(&filter_schema_2)); Review Comment: > We need reassign_predicate_columns to work, that's what gets called from within ParquetSource, etc We can also change `reassign_predicate_columns` inside Parquet if that bring us to the better state. From my view, `reassign_predicate_columns` is the root cause why you ends up `with_new_children` that doesn't actually updating the "children". -- 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