File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change 1919use arrow_array:: { Float64Array , Int64Array , RecordBatch } ;
2020use datafusion:: {
2121 functions_aggregate:: {
22- count:: count,
22+ count:: { count, count_distinct } ,
2323 expr_fn:: avg,
2424 min_max:: { max, min} ,
2525 sum:: sum,
@@ -387,6 +387,7 @@ fn match_aggregate_operation(agg: &AggregateConfig) -> Expr {
387387 let column = format ! ( r#""{}""# , agg. column) ;
388388 match agg. aggregate_function {
389389 AggregateFunction :: Avg => avg ( col ( column) ) ,
390+ AggregateFunction :: CountDistinct => count_distinct ( col ( column) ) ,
390391 AggregateFunction :: Count => count ( col ( column) ) ,
391392 AggregateFunction :: Min => min ( col ( column) ) ,
392393 AggregateFunction :: Max => max ( col ( column) ) ,
Original file line number Diff line number Diff line change @@ -290,6 +290,7 @@ impl Display for WhereConfigOperator {
290290pub enum AggregateFunction {
291291 Avg ,
292292 Count ,
293+ CountDistinct ,
293294 Min ,
294295 Max ,
295296 Sum ,
@@ -300,6 +301,7 @@ impl Display for AggregateFunction {
300301 match self {
301302 AggregateFunction :: Avg => write ! ( f, "Avg" ) ,
302303 AggregateFunction :: Count => write ! ( f, "Count" ) ,
304+ AggregateFunction :: CountDistinct => write ! ( f, "CountDistinct" ) ,
303305 AggregateFunction :: Min => write ! ( f, "Min" ) ,
304306 AggregateFunction :: Max => write ! ( f, "Max" ) ,
305307 AggregateFunction :: Sum => write ! ( f, "Sum" ) ,
You can’t perform that action at this time.
0 commit comments