File tree 2 files changed +4
-1
lines changed
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change 19
19
use arrow_array:: { Float64Array , Int64Array , RecordBatch } ;
20
20
use datafusion:: {
21
21
functions_aggregate:: {
22
- count:: count,
22
+ count:: { count, count_distinct } ,
23
23
expr_fn:: avg,
24
24
min_max:: { max, min} ,
25
25
sum:: sum,
@@ -387,6 +387,7 @@ fn match_aggregate_operation(agg: &AggregateConfig) -> Expr {
387
387
let column = format ! ( r#""{}""# , agg. column) ;
388
388
match agg. aggregate_function {
389
389
AggregateFunction :: Avg => avg ( col ( column) ) ,
390
+ AggregateFunction :: CountDistinct => count_distinct ( col ( column) ) ,
390
391
AggregateFunction :: Count => count ( col ( column) ) ,
391
392
AggregateFunction :: Min => min ( col ( column) ) ,
392
393
AggregateFunction :: Max => max ( col ( column) ) ,
Original file line number Diff line number Diff line change @@ -290,6 +290,7 @@ impl Display for WhereConfigOperator {
290
290
pub enum AggregateFunction {
291
291
Avg ,
292
292
Count ,
293
+ CountDistinct ,
293
294
Min ,
294
295
Max ,
295
296
Sum ,
@@ -300,6 +301,7 @@ impl Display for AggregateFunction {
300
301
match self {
301
302
AggregateFunction :: Avg => write ! ( f, "Avg" ) ,
302
303
AggregateFunction :: Count => write ! ( f, "Count" ) ,
304
+ AggregateFunction :: CountDistinct => write ! ( f, "CountDistinct" ) ,
303
305
AggregateFunction :: Min => write ! ( f, "Min" ) ,
304
306
AggregateFunction :: Max => write ! ( f, "Max" ) ,
305
307
AggregateFunction :: Sum => write ! ( f, "Sum" ) ,
You can’t perform that action at this time.
0 commit comments