comphead commented on code in PR #17831:
URL: https://github.com/apache/datafusion/pull/17831#discussion_r2389129344
##########
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:
Thanks @alamb
`cloned()` on iter calls a clone under the hood for each element?
https://doc.rust-lang.org/beta/std/iter/trait.Iterator.html#method.cloned
I'm trying to figure out the benefit
--
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]