Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions datafusion/expr/src/logical_plan/tree_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,11 @@ impl LogicalPlan {
filters.apply_elements(f)
}
LogicalPlan::Unnest(unnest) => {
let columns = unnest.exec_columns.clone();

let exprs = columns
let exprs = unnest
.exec_columns
.iter()
.map(|c| Expr::Column(c.clone()))
.cloned()
.map(Expr::Column)
.collect::<Vec<_>>();
exprs.apply_elements(f)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ impl TreeNodeRewriter for ShortenInListSimplifier {
// if expr is a single column reference:
// expr IN (A, B, ...) --> (expr = A) OR (expr = B) OR (expr = C)
if let Expr::InList(InList {
expr,
list,
ref expr,
ref list,
negated,
}) = expr.clone()
}) = expr
{
if !list.is_empty()
&& (
Expand All @@ -57,7 +57,7 @@ impl TreeNodeRewriter for ShortenInListSimplifier {
{
let first_val = list[0].clone();
if negated {
return Ok(Transformed::yes(list.into_iter().skip(1).fold(
return Ok(Transformed::yes(list.iter().skip(1).cloned().fold(
(*expr.clone()).not_eq(first_val),
|acc, y| {
// Note that `A and B and C and D` is a left-deep tree structure
Expand All @@ -81,7 +81,7 @@ impl TreeNodeRewriter for ShortenInListSimplifier {
},
)));
} else {
return Ok(Transformed::yes(list.into_iter().skip(1).fold(
return Ok(Transformed::yes(list.iter().skip(1).cloned().fold(
(*expr.clone()).eq(first_val),
|acc, y| {
// Same reasoning as above
Expand Down