LiaCastaneda commented on code in PR #20337:
URL: https://github.com/apache/datafusion/pull/20337#discussion_r2811216958


##########
datafusion/core/tests/physical_optimizer/filter_pushdown.rs:
##########
@@ -3868,3 +3868,103 @@ async fn test_filter_with_projection_pushdown() {
     ];
     assert_batches_eq!(expected, &result);
 }
+
+/// Test that ExecutionPlan::expressions() can discover dynamic filters across 
the plan tree
+#[tokio::test]
+async fn test_discover_dynamic_filters_via_expressions_api() {
+    use datafusion_common::JoinType;
+    use datafusion_physical_expr::expressions::DynamicFilterPhysicalExpr;
+    use datafusion_physical_plan::joins::{HashJoinExec, PartitionMode};
+
+    fn count_dynamic_filters(plan: &Arc<dyn ExecutionPlan>) -> usize {
+        let mut count = 0;
+
+        // Check expressions from this node
+        let exprs = plan.expressions();
+        for expr in exprs.iter() {
+            if let Some(_df) = 
expr.as_any().downcast_ref::<DynamicFilterPhysicalExpr>() {

Review Comment:
   about deduping, the objective of this test is to prove how many times the 
Dynamic Filter appears in the plan and if each node is able count how many 
dynamic filters it contains, if we dedup then we would count it once only



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