File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
optimizer/src/simplify_expressions Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -436,11 +436,11 @@ impl LogicalPlan {
436436 filters. apply_elements ( f)
437437 }
438438 LogicalPlan :: Unnest ( unnest) => {
439- let columns = unnest. exec_columns . clone ( ) ;
440-
441- let exprs = columns
439+ let exprs = unnest
440+ . exec_columns
442441 . iter ( )
443- . map ( |c| Expr :: Column ( c. clone ( ) ) )
442+ . cloned ( )
443+ . map ( Expr :: Column )
444444 . collect :: < Vec < _ > > ( ) ;
445445 exprs. apply_elements ( f)
446446 }
Original file line number Diff line number Diff line change @@ -39,10 +39,10 @@ impl TreeNodeRewriter for ShortenInListSimplifier {
3939 // if expr is a single column reference:
4040 // expr IN (A, B, ...) --> (expr = A) OR (expr = B) OR (expr = C)
4141 if let Expr :: InList ( InList {
42- expr,
43- list,
42+ ref expr,
43+ ref list,
4444 negated,
45- } ) = expr. clone ( )
45+ } ) = expr
4646 {
4747 if !list. is_empty ( )
4848 && (
@@ -57,7 +57,7 @@ impl TreeNodeRewriter for ShortenInListSimplifier {
5757 {
5858 let first_val = list[ 0 ] . clone ( ) ;
5959 if negated {
60- return Ok ( Transformed :: yes ( list. into_iter ( ) . skip ( 1 ) . fold (
60+ return Ok ( Transformed :: yes ( list. iter ( ) . skip ( 1 ) . cloned ( ) . fold (
6161 ( * expr. clone ( ) ) . not_eq ( first_val) ,
6262 |acc, y| {
6363 // Note that `A and B and C and D` is a left-deep tree structure
@@ -81,7 +81,7 @@ impl TreeNodeRewriter for ShortenInListSimplifier {
8181 } ,
8282 ) ) ) ;
8383 } else {
84- return Ok ( Transformed :: yes ( list. into_iter ( ) . skip ( 1 ) . fold (
84+ return Ok ( Transformed :: yes ( list. iter ( ) . skip ( 1 ) . cloned ( ) . fold (
8585 ( * expr. clone ( ) ) . eq ( first_val) ,
8686 |acc, y| {
8787 // Same reasoning as above
You can’t perform that action at this time.
0 commit comments