Skip to content

Commit 01831af

Browse files
committed
implement_group_accumulators_count_distinct
1 parent e12c1bc commit 01831af

2 files changed

Lines changed: 26 additions & 3 deletions

File tree

  • datafusion
    • functions-aggregate-common/src/aggregate/count_distinct
    • functions-aggregate/src

datafusion/functions-aggregate-common/src/aggregate/count_distinct/groups.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
118
use arrow::array::{
219
Array, ArrayRef, AsArray, BooleanArray, Int64Array, ListBuilder, PrimitiveBuilder,
320
};

datafusion/functions-aggregate/src/count.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,13 +381,19 @@ impl AggregateUDFImpl for Count {
381381
PrimitiveDistinctCountGroupsAccumulator::<UInt8Type>::new(),
382382
)),
383383
DataType::UInt16 => {
384-
Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<UInt16Type>::new()))
384+
Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<
385+
UInt16Type,
386+
>::new()))
385387
}
386388
DataType::UInt32 => {
387-
Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<UInt32Type>::new()))
389+
Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<
390+
UInt32Type,
391+
>::new()))
388392
}
389393
DataType::UInt64 => {
390-
Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<UInt64Type>::new()))
394+
Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<
395+
UInt64Type,
396+
>::new()))
391397
}
392398
_ => not_impl_err!(
393399
"GroupsAccumulator not supported for COUNT(DISTINCT) with {}",

0 commit comments

Comments
 (0)