findepi commented on code in PR #17831:
URL: https://github.com/apache/datafusion/pull/17831#discussion_r2390273951


##########
datafusion/optimizer/src/push_down_filter.rs:
##########
@@ -530,14 +530,17 @@ fn push_down_join(
     parent_predicate: Option<&Expr>,
 ) -> Result<Transformed<LogicalPlan>> {
     // Split the parent predicate into individual conjunctive parts.
-    let predicates = parent_predicate
-        .map_or_else(Vec::new, |pred| split_conjunction_owned(pred.clone()));
+    let predicates =
+        parent_predicate.map_or_else(Vec::new, |pred| split_conjunction(pred));
 
     // Extract conjunctions from the JOIN's ON filter, if present.
     let on_filters = join
         .filter
         .as_ref()
-        .map_or_else(Vec::new, |filter| 
split_conjunction_owned(filter.clone()));
+        .map_or_else(Vec::new, |filter| split_conjunction(filter));
+
+    let predicates: Vec<Expr> = predicates.into_iter().cloned().collect();

Review Comment:
   The `split_conjunction_owned` -> `split_conjunction` change above avoids 
cloning the `pred` components.
   But any benefit seems to be indeed voided by cloning here, which we execute 
unconditionally.



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