jayzhan211 commented on code in PR #15685:
URL: https://github.com/apache/datafusion/pull/15685#discussion_r2040505924
##########
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:
If you really want to keep `reassign_predicate_columns` for whatever reason,
you should pass the `inner` of `DynamicFilterPhysicalExpr` instead, so you are
only modifying the `inner` and not the whole `DynamicFilterPhysicalExpr`. The
difference is that the `with_new_children` is not called on the
`DynamicFilterPhysicalExpr` level.
--
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]