@@ -88,7 +88,7 @@ impl AggregateExprBuilder {
8888 }
8989 }
9090
91- pub fn build ( self ) -> Result < Arc < AggregateFunctionExpr > > {
91+ pub fn build ( self ) -> Result < AggregateFunctionExpr > {
9292 let Self {
9393 fun,
9494 args,
@@ -132,7 +132,7 @@ impl AggregateExprBuilder {
132132 Some ( alias) => alias,
133133 } ;
134134
135- Ok ( Arc :: new ( AggregateFunctionExpr {
135+ Ok ( AggregateFunctionExpr {
136136 fun : Arc :: unwrap_or_clone ( fun) ,
137137 args,
138138 data_type,
@@ -145,7 +145,7 @@ impl AggregateExprBuilder {
145145 input_types : input_exprs_types,
146146 is_reversed,
147147 is_nullable,
148- } ) )
148+ } )
149149 }
150150
151151 pub fn alias ( mut self , alias : impl Into < String > ) -> Self {
@@ -328,9 +328,9 @@ impl AggregateFunctionExpr {
328328 /// not implement the method, returns an error. Order insensitive and hard
329329 /// requirement aggregators return `Ok(None)`.
330330 pub fn with_beneficial_ordering (
331- self : Arc < Self > ,
331+ self ,
332332 beneficial_ordering : bool ,
333- ) -> Result < Option < Arc < AggregateFunctionExpr > > > {
333+ ) -> Result < Option < AggregateFunctionExpr > > {
334334 let Some ( updated_fn) = self
335335 . fun
336336 . clone ( )
@@ -457,10 +457,10 @@ impl AggregateFunctionExpr {
457457 /// Typically the "reverse" expression is itself (e.g. SUM, COUNT).
458458 /// For aggregates that do not support calculation in reverse,
459459 /// returns None (which is the default value).
460- pub fn reverse_expr ( & self ) -> Option < Arc < AggregateFunctionExpr > > {
460+ pub fn reverse_expr ( & self ) -> Option < AggregateFunctionExpr > {
461461 match self . fun . reverse_udf ( ) {
462462 ReversedUDAF :: NotSupported => None ,
463- ReversedUDAF :: Identical => Some ( Arc :: new ( self . clone ( ) ) ) ,
463+ ReversedUDAF :: Identical => Some ( self . clone ( ) ) ,
464464 ReversedUDAF :: Reversed ( reverse_udf) => {
465465 let reverse_ordering_req = reverse_order_bys ( & self . ordering_req ) ;
466466 let mut name = self . name ( ) . to_string ( ) ;
@@ -507,7 +507,7 @@ impl AggregateFunctionExpr {
507507 & self ,
508508 _args : Vec < Arc < dyn PhysicalExpr > > ,
509509 _order_by_exprs : Vec < Arc < dyn PhysicalExpr > > ,
510- ) -> Option < Arc < AggregateFunctionExpr > > {
510+ ) -> Option < AggregateFunctionExpr > {
511511 None
512512 }
513513
0 commit comments