@@ -211,7 +211,7 @@ impl LogicalPlanBuilder {
211
211
} ;
212
212
common_type = Some ( new_type) ;
213
213
} else {
214
- common_type = Some ( data_type. clone ( ) ) ;
214
+ common_type = Some ( data_type) ;
215
215
}
216
216
}
217
217
field_types. push ( common_type. unwrap_or ( DataType :: Utf8 ) ) ;
@@ -220,7 +220,7 @@ impl LogicalPlanBuilder {
220
220
for row in & mut values {
221
221
for ( j, field_type) in field_types. iter ( ) . enumerate ( ) {
222
222
if let Expr :: Literal ( ScalarValue :: Null ) = row[ j] {
223
- row[ j] = Expr :: Literal ( ScalarValue :: try_from ( field_type. clone ( ) ) ?) ;
223
+ row[ j] = Expr :: Literal ( ScalarValue :: try_from ( field_type) ?) ;
224
224
} else {
225
225
row[ j] =
226
226
std:: mem:: take ( & mut row[ j] ) . cast_to ( field_type, & empty_schema) ?;
@@ -552,20 +552,17 @@ impl LogicalPlanBuilder {
552
552
553
553
// Collect sort columns that are missing in the input plan's schema
554
554
let mut missing_cols: Vec < Column > = vec ! [ ] ;
555
- exprs
556
- . clone ( )
557
- . into_iter ( )
558
- . try_for_each :: < _ , Result < ( ) > > ( |expr| {
559
- let columns = expr. column_refs ( ) ;
555
+ exprs. iter ( ) . try_for_each :: < _ , Result < ( ) > > ( |expr| {
556
+ let columns = expr. column_refs ( ) ;
560
557
561
- columns. into_iter ( ) . for_each ( |c| {
562
- if !schema. has_column ( c) {
563
- missing_cols. push ( c. clone ( ) ) ;
564
- }
565
- } ) ;
558
+ columns. into_iter ( ) . for_each ( |c| {
559
+ if !schema. has_column ( c) {
560
+ missing_cols. push ( c. clone ( ) ) ;
561
+ }
562
+ } ) ;
566
563
567
- Ok ( ( ) )
568
- } ) ?;
564
+ Ok ( ( ) )
565
+ } ) ?;
569
566
570
567
if missing_cols. is_empty ( ) {
571
568
return Ok ( Self :: new ( LogicalPlan :: Sort ( Sort {
@@ -710,7 +707,7 @@ impl LogicalPlanBuilder {
710
707
711
708
pub ( crate ) fn normalize (
712
709
plan : & LogicalPlan ,
713
- column : impl Into < Column > + Clone ,
710
+ column : impl Into < Column > ,
714
711
) -> Result < Column > {
715
712
let schema = plan. schema ( ) ;
716
713
let fallback_schemas = plan. fallback_normalize_schemas ( ) ;
@@ -1536,7 +1533,7 @@ pub fn get_unnested_columns(
1536
1533
| DataType :: FixedSizeList ( field, _)
1537
1534
| DataType :: LargeList ( field) => {
1538
1535
let new_field = Arc :: new ( Field :: new (
1539
- col_name. clone ( ) ,
1536
+ col_name,
1540
1537
field. data_type ( ) . clone ( ) ,
1541
1538
// Unnesting may produce NULLs even if the list is not null.
1542
1539
// For example: unnset([1], []) -> 1, null
0 commit comments