From 1ddc00e2b3877c4f1544bef4275bcfaf68e2a8e5 Mon Sep 17 00:00:00 2001 From: jayzhan211 Date: Thu, 20 Jun 2024 09:24:22 +0800 Subject: [PATCH] add doc Signed-off-by: jayzhan211 --- datafusion/optimizer/src/push_down_filter.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/datafusion/optimizer/src/push_down_filter.rs b/datafusion/optimizer/src/push_down_filter.rs index 2b220b60423b..754f62d19729 100644 --- a/datafusion/optimizer/src/push_down_filter.rs +++ b/datafusion/optimizer/src/push_down_filter.rs @@ -725,6 +725,8 @@ impl OptimizerRule for PushDownFilter { } } + // Unnest predicates should not be pushed down. + // If no non-unnest predicates exist, early return if non_unnest_predicates.is_empty() { filter.input = Arc::new(LogicalPlan::Unnest(unnest)); return Ok(Transformed::no(LogicalPlan::Filter(filter))); @@ -762,7 +764,8 @@ impl OptimizerRule for PushDownFilter { let predicate = conjunction(vec![ unnest_predicate, keep_predicate, - ]).unwrap(); // Safe to unwrap since filters is non-empty + ]) + .unwrap(); // Safe to unwrap since filters is non-empty Ok(Transformed::yes(LogicalPlan::Filter( Filter::try_new( predicate,