15
15
// specific language governing permissions and limitations
16
16
// under the License.
17
17
18
- pub mod count_distinct;
19
- pub mod groups_accumulator;
20
- pub mod merge_arrays;
21
- pub mod stats;
22
- pub mod tdigest;
23
- pub mod utils;
18
+ use std:: fmt:: Debug ;
19
+ use std:: { any:: Any , sync:: Arc } ;
24
20
25
21
use arrow:: datatypes:: { DataType , Field , Schema , SchemaRef } ;
22
+
23
+ use datafusion_common:: exec_err;
26
24
use datafusion_common:: { internal_err, not_impl_err, DFSchema , Result } ;
27
25
use datafusion_expr:: function:: StateFieldsArgs ;
28
26
use datafusion_expr:: type_coercion:: aggregates:: check_arg_count;
27
+ use datafusion_expr:: utils:: AggregateOrderSensitivity ;
29
28
use datafusion_expr:: ReversedUDAF ;
30
29
use datafusion_expr:: {
31
30
function:: AccumulatorArgs , Accumulator , AggregateUDF , Expr , GroupsAccumulator ,
32
31
} ;
33
- use std:: fmt:: Debug ;
34
- use std:: { any:: Any , sync:: Arc } ;
35
32
36
- use self :: utils:: down_cast_any_ref;
37
33
use crate :: physical_expr:: PhysicalExpr ;
38
34
use crate :: sort_expr:: { LexOrdering , PhysicalSortExpr } ;
39
35
use crate :: utils:: reverse_order_bys;
40
36
41
- use datafusion_common:: exec_err;
42
- use datafusion_expr:: utils:: AggregateOrderSensitivity ;
37
+ use self :: utils:: down_cast_any_ref;
38
+
39
+ pub mod count_distinct;
40
+ pub mod groups_accumulator;
41
+ pub mod merge_arrays;
42
+ pub mod stats;
43
+ pub mod tdigest;
44
+ pub mod utils;
43
45
44
46
/// Creates a physical expression of the UDAF, that includes all necessary type coercion.
45
47
/// This function errors when `args`' can't be coerced to a valid argument type of the UDAF.
@@ -225,7 +227,7 @@ impl AggregateExprBuilder {
225
227
ignore_nulls,
226
228
ordering_fields,
227
229
is_distinct,
228
- input_type : input_exprs_types[ 0 ] . clone ( ) ,
230
+ input_types : input_exprs_types,
229
231
is_reversed,
230
232
} ) )
231
233
}
@@ -466,7 +468,7 @@ pub struct AggregateFunctionExpr {
466
468
ordering_fields : Vec < Field > ,
467
469
is_distinct : bool ,
468
470
is_reversed : bool ,
469
- input_type : DataType ,
471
+ input_types : Vec < DataType > ,
470
472
}
471
473
472
474
impl AggregateFunctionExpr {
@@ -504,7 +506,7 @@ impl AggregateExpr for AggregateFunctionExpr {
504
506
fn state_fields ( & self ) -> Result < Vec < Field > > {
505
507
let args = StateFieldsArgs {
506
508
name : & self . name ,
507
- input_type : & self . input_type ,
509
+ input_types : & self . input_types ,
508
510
return_type : & self . data_type ,
509
511
ordering_fields : & self . ordering_fields ,
510
512
is_distinct : self . is_distinct ,
@@ -525,7 +527,7 @@ impl AggregateExpr for AggregateFunctionExpr {
525
527
ignore_nulls : self . ignore_nulls ,
526
528
sort_exprs : & self . sort_exprs ,
527
529
is_distinct : self . is_distinct ,
528
- input_type : & self . input_type ,
530
+ input_types : & self . input_types ,
529
531
input_exprs : & self . logical_args ,
530
532
name : & self . name ,
531
533
is_reversed : self . is_reversed ,
@@ -542,7 +544,7 @@ impl AggregateExpr for AggregateFunctionExpr {
542
544
ignore_nulls : self . ignore_nulls ,
543
545
sort_exprs : & self . sort_exprs ,
544
546
is_distinct : self . is_distinct ,
545
- input_type : & self . input_type ,
547
+ input_types : & self . input_types ,
546
548
input_exprs : & self . logical_args ,
547
549
name : & self . name ,
548
550
is_reversed : self . is_reversed ,
@@ -614,7 +616,7 @@ impl AggregateExpr for AggregateFunctionExpr {
614
616
ignore_nulls : self . ignore_nulls ,
615
617
sort_exprs : & self . sort_exprs ,
616
618
is_distinct : self . is_distinct ,
617
- input_type : & self . input_type ,
619
+ input_types : & self . input_types ,
618
620
input_exprs : & self . logical_args ,
619
621
name : & self . name ,
620
622
is_reversed : self . is_reversed ,
@@ -630,7 +632,7 @@ impl AggregateExpr for AggregateFunctionExpr {
630
632
ignore_nulls : self . ignore_nulls ,
631
633
sort_exprs : & self . sort_exprs ,
632
634
is_distinct : self . is_distinct ,
633
- input_type : & self . input_type ,
635
+ input_types : & self . input_types ,
634
636
input_exprs : & self . logical_args ,
635
637
name : & self . name ,
636
638
is_reversed : self . is_reversed ,
0 commit comments