@@ -433,6 +433,7 @@ where
433433 T : Transaction ,
434434 A : AsRef < [ ( & ' static str , DataValue ) ] > ,
435435{
436+ #[ allow( clippy:: wrong_self_convention) ]
436437 pub ( crate ) fn from_plan (
437438 self ,
438439 plan : LogicalPlan ,
@@ -504,26 +505,27 @@ where
504505 |binder, orderby| bind_sort_field ( binder, self . arena , orderby) ,
505506 ) ?;
506507 }
507-
508508 if !self . binder . context . agg_calls . is_empty ( )
509509 || !self . binder . context . group_by_exprs . is_empty ( )
510510 {
511511 let agg_calls = std:: mem:: take ( & mut self . binder . context . agg_calls ) ;
512512 let group_by_exprs = std:: mem:: take ( & mut self . binder . context . group_by_exprs ) ;
513+ let output_exprs = self
514+ . select_list
515+ . iter_mut ( )
516+ . chain ( having_orderby. 0 . iter_mut ( ) )
517+ . chain (
518+ having_orderby
519+ . 1
520+ . iter_mut ( )
521+ . flat_map ( |fields| fields. iter_mut ( ) . map ( |field| & mut field. expr ) ) ,
522+ ) ;
513523 self . binder . bind_aggregate_output_exprs_with_outputs (
514524 & agg_calls,
515525 & group_by_exprs,
516- self . select_list . iter_mut ( ) ,
526+ output_exprs ,
517527 self . arena ,
518528 ) ?;
519- if let Some ( orderby) = having_orderby. 1 . as_mut ( ) {
520- self . binder . bind_aggregate_output_exprs_with_outputs (
521- & agg_calls,
522- & group_by_exprs,
523- orderby. iter_mut ( ) . map ( |field| & mut field. expr ) ,
524- self . arena ,
525- ) ?;
526- }
527529 self . plan = self
528530 . binder
529531 . bind_aggregate ( self . plan , agg_calls, group_by_exprs) ?;
@@ -1062,7 +1064,7 @@ impl<'a: 'b, 'b, T: Transaction, A: AsRef<[(&'static str, DataValue)]>> Binder<'
10621064 let source_column = arena. column ( column) ;
10631065 (
10641066 source_column. clone ( ) ,
1065- source_column. id ( ) . unwrap_or ( ColumnId :: new ( ) ) ,
1067+ source_column. id ( ) . unwrap_or_default ( ) ,
10661068 matches ! (
10671069 & source_column. summary( ) . relation,
10681070 ColumnRelation :: Table { is_temp: true , .. }
@@ -1107,7 +1109,7 @@ impl<'a: 'b, 'b, T: Transaction, A: AsRef<[(&'static str, DataValue)]>> Binder<'
11071109 let mut source_column = column_catalog. clone ( ) ;
11081110 source_column. set_ref_table (
11091111 source_name. clone ( ) ,
1110- column_catalog. id ( ) . unwrap_or ( ColumnId :: new ( ) ) ,
1112+ column_catalog. id ( ) . unwrap_or_default ( ) ,
11111113 true ,
11121114 ) ;
11131115 source_column
@@ -1303,7 +1305,7 @@ impl<'a: 'b, 'b, T: Transaction, A: AsRef<[(&'static str, DataValue)]>> Binder<'
13031305 else {
13041306 continue ;
13051307 } ;
1306- if !fn_not_on_using ( & column) {
1308+ if !fn_not_on_using ( column) {
13071309 continue ;
13081310 }
13091311 exprs. push ( ScalarExpression :: column_expr (
@@ -1318,7 +1320,7 @@ impl<'a: 'b, 'b, T: Transaction, A: AsRef<[(&'static str, DataValue)]>> Binder<'
13181320 }
13191321
13201322 for ( position, column) in source. schema ( ) . iter ( ) . enumerate ( ) {
1321- if !fn_not_on_using ( & column) {
1323+ if !fn_not_on_using ( column) {
13221324 continue ;
13231325 }
13241326 exprs. push ( ScalarExpression :: column_expr (
@@ -1523,6 +1525,7 @@ impl<'a: 'b, 'b, T: Transaction, A: AsRef<[(&'static str, DataValue)]>> Binder<'
15231525 Vec :: new ( )
15241526 }
15251527
1528+ #[ allow( clippy:: too_many_arguments) ]
15261529 fn prepare_mark_apply (
15271530 predicate : & mut ScalarExpression ,
15281531 output_column : & ColumnRef ,
@@ -2270,11 +2273,11 @@ mod tests {
22702273 true ,
22712274 ColumnDesc :: new ( LogicalType :: Integer , None , false , None ) . unwrap ( ) ,
22722275 ) ) ;
2273- let right_schema = vec ! [ right_column. clone ( ) ] ;
2276+ let right_schema = vec ! [ right_column] ;
22742277 let mut expr = ScalarExpression :: Binary {
22752278 op : crate :: expression:: BinaryOperator :: Eq ,
22762279 left_expr : Box :: new ( ScalarExpression :: column_expr ( left_column, 0 ) ) ,
2277- right_expr : Box :: new ( ScalarExpression :: column_expr ( right_column. clone ( ) , 0 ) ) ,
2280+ right_expr : Box :: new ( ScalarExpression :: column_expr ( right_column, 0 ) ) ,
22782281 evaluator : None ,
22792282 ty : LogicalType :: Boolean ,
22802283 } ;
0 commit comments