@@ -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 {
@@ -328,9 +328,9 @@ impl AggregateFunctionExpr {
328
328
/// not implement the method, returns an error. Order insensitive and hard
329
329
/// requirement aggregators return `Ok(None)`.
330
330
pub fn with_beneficial_ordering (
331
- self : Arc < Self > ,
331
+ self ,
332
332
beneficial_ordering : bool ,
333
- ) -> Result < Option < Arc < AggregateFunctionExpr > > > {
333
+ ) -> Result < Option < AggregateFunctionExpr > > {
334
334
let Some ( updated_fn) = self
335
335
. fun
336
336
. clone ( )
@@ -457,10 +457,10 @@ impl AggregateFunctionExpr {
457
457
/// Typically the "reverse" expression is itself (e.g. SUM, COUNT).
458
458
/// For aggregates that do not support calculation in reverse,
459
459
/// returns None (which is the default value).
460
- pub fn reverse_expr ( & self ) -> Option < Arc < AggregateFunctionExpr > > {
460
+ pub fn reverse_expr ( & self ) -> Option < AggregateFunctionExpr > {
461
461
match self . fun . reverse_udf ( ) {
462
462
ReversedUDAF :: NotSupported => None ,
463
- ReversedUDAF :: Identical => Some ( Arc :: new ( self . clone ( ) ) ) ,
463
+ ReversedUDAF :: Identical => Some ( self . clone ( ) ) ,
464
464
ReversedUDAF :: Reversed ( reverse_udf) => {
465
465
let reverse_ordering_req = reverse_order_bys ( & self . ordering_req ) ;
466
466
let mut name = self . name ( ) . to_string ( ) ;
@@ -507,7 +507,7 @@ impl AggregateFunctionExpr {
507
507
& self ,
508
508
_args : Vec < Arc < dyn PhysicalExpr > > ,
509
509
_order_by_exprs : Vec < Arc < dyn PhysicalExpr > > ,
510
- ) -> Option < Arc < AggregateFunctionExpr > > {
510
+ ) -> Option < AggregateFunctionExpr > {
511
511
None
512
512
}
513
513
0 commit comments