Skip to content

Commit

Permalink
Minor: Only clone in FilterNullJoinKeys when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed May 8, 2024
1 parent e024529 commit cc779fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions datafusion/optimizer/src/filter_null_join_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ impl OptimizerRule for FilterNullJoinKeys {

for (l, r) in &join.on {
if l.nullable(left_schema)? {
left_filters.push(l.clone());
left_filters.push(l);
}

if r.nullable(right_schema)? {
right_filters.push(r.clone());
right_filters.push(r);
}
}

Expand All @@ -100,10 +100,10 @@ impl OptimizerRule for FilterNullJoinKeys {
}
}

fn create_not_null_predicate(filters: Vec<Expr>) -> Expr {
fn create_not_null_predicate(filters: Vec<&Expr>) -> Expr {
let not_null_exprs: Vec<Expr> = filters
.into_iter()
.map(|c| Expr::IsNotNull(Box::new(c)))
.map(|c| c.clone().is_not_null())
.collect();

// directly unwrap since it should always have a value
Expand Down

0 comments on commit cc779fd

Please sign in to comment.