@@ -88,7 +88,7 @@ impl AggregateExprBuilder {
88
88
}
89
89
}
90
90
91
- pub fn build ( self ) -> Result < Arc < AggregateFunctionExpr > > {
91
+ pub fn build ( self ) -> Result < AggregateFunctionExpr > {
92
92
let Self {
93
93
fun,
94
94
args,
@@ -132,7 +132,7 @@ impl AggregateExprBuilder {
132
132
Some ( alias) => alias,
133
133
} ;
134
134
135
- Ok ( Arc :: new ( AggregateFunctionExpr {
135
+ Ok ( AggregateFunctionExpr {
136
136
fun : Arc :: unwrap_or_clone ( fun) ,
137
137
args,
138
138
data_type,
@@ -145,7 +145,7 @@ impl AggregateExprBuilder {
145
145
input_types : input_exprs_types,
146
146
is_reversed,
147
147
is_nullable,
148
- } ) )
148
+ } )
149
149
}
150
150
151
151
pub fn alias ( mut self , alias : impl Into < String > ) -> Self {
@@ -332,9 +332,9 @@ impl AggregateFunctionExpr {
332
332
/// not implement the method, returns an error. Order insensitive and hard
333
333
/// requirement aggregators return `Ok(None)`.
334
334
pub fn with_beneficial_ordering (
335
- self : Arc < Self > ,
335
+ self ,
336
336
beneficial_ordering : bool ,
337
- ) -> Result < Option < Arc < AggregateFunctionExpr > > > {
337
+ ) -> Result < Option < AggregateFunctionExpr > > {
338
338
let Some ( updated_fn) = self
339
339
. fun
340
340
. clone ( )
@@ -461,10 +461,10 @@ impl AggregateFunctionExpr {
461
461
/// Typically the "reverse" expression is itself (e.g. SUM, COUNT).
462
462
/// For aggregates that do not support calculation in reverse,
463
463
/// returns None (which is the default value).
464
- pub fn reverse_expr ( & self ) -> Option < Arc < AggregateFunctionExpr > > {
464
+ pub fn reverse_expr ( & self ) -> Option < AggregateFunctionExpr > {
465
465
match self . fun . reverse_udf ( ) {
466
466
ReversedUDAF :: NotSupported => None ,
467
- ReversedUDAF :: Identical => Some ( Arc :: new ( self . clone ( ) ) ) ,
467
+ ReversedUDAF :: Identical => Some ( self . clone ( ) ) ,
468
468
ReversedUDAF :: Reversed ( reverse_udf) => {
469
469
let reverse_ordering_req = reverse_order_bys ( & self . ordering_req ) ;
470
470
let mut name = self . name ( ) . to_string ( ) ;
@@ -511,7 +511,7 @@ impl AggregateFunctionExpr {
511
511
& self ,
512
512
_args : Vec < Arc < dyn PhysicalExpr > > ,
513
513
_order_by_exprs : Vec < Arc < dyn PhysicalExpr > > ,
514
- ) -> Option < Arc < AggregateFunctionExpr > > {
514
+ ) -> Option < AggregateFunctionExpr > {
515
515
None
516
516
}
517
517
0 commit comments