Skip to content

Commit a4ddea9

Browse files
author
B Vadlamani
committed
hashtable_with_count_vector_approach
1 parent b9dcf85 commit a4ddea9

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

  • datafusion/functions-aggregate/src

datafusion/functions-aggregate/src/count.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ impl AggregateUDFImpl for Count {
363363
if !args.is_distinct {
364364
return Ok(Box::new(CountGroupsAccumulator::new()));
365365
}
366-
create_distinct_count_groups_accumulator(args)
366+
create_distinct_count_groups_accumulator(&args)
367367
}
368368

369369
fn reverse_expr(&self) -> ReversedUDAF {
@@ -439,34 +439,34 @@ impl AggregateUDFImpl for Count {
439439

440440
#[cold]
441441
fn create_distinct_count_groups_accumulator(
442-
args: AccumulatorArgs,
442+
args: &AccumulatorArgs,
443443
) -> Result<Box<dyn GroupsAccumulator>> {
444444
let data_type = args.expr_fields[0].data_type();
445445
match data_type {
446446
DataType::Int8 => Ok(Box::new(
447447
PrimitiveDistinctCountGroupsAccumulator::<Int8Type>::new(),
448448
)),
449-
DataType::Int16 => Ok(Box::new(
450-
PrimitiveDistinctCountGroupsAccumulator::<Int16Type>::new(),
451-
)),
452-
DataType::Int32 => Ok(Box::new(
453-
PrimitiveDistinctCountGroupsAccumulator::<Int32Type>::new(),
454-
)),
455-
DataType::Int64 => Ok(Box::new(
456-
PrimitiveDistinctCountGroupsAccumulator::<Int64Type>::new(),
457-
)),
458-
DataType::UInt8 => Ok(Box::new(
459-
PrimitiveDistinctCountGroupsAccumulator::<UInt8Type>::new(),
460-
)),
461-
DataType::UInt16 => Ok(Box::new(
462-
PrimitiveDistinctCountGroupsAccumulator::<UInt16Type>::new(),
463-
)),
464-
DataType::UInt32 => Ok(Box::new(
465-
PrimitiveDistinctCountGroupsAccumulator::<UInt32Type>::new(),
466-
)),
467-
DataType::UInt64 => Ok(Box::new(
468-
PrimitiveDistinctCountGroupsAccumulator::<UInt64Type>::new(),
469-
)),
449+
DataType::Int16 => Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<
450+
Int16Type,
451+
>::new())),
452+
DataType::Int32 => Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<
453+
Int32Type,
454+
>::new())),
455+
DataType::Int64 => Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<
456+
Int64Type,
457+
>::new())),
458+
DataType::UInt8 => Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<
459+
UInt8Type,
460+
>::new())),
461+
DataType::UInt16 => Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<
462+
UInt16Type,
463+
>::new())),
464+
DataType::UInt32 => Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<
465+
UInt32Type,
466+
>::new())),
467+
DataType::UInt64 => Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<
468+
UInt64Type,
469+
>::new())),
470470
_ => not_impl_err!(
471471
"GroupsAccumulator not supported for COUNT(DISTINCT) with {}",
472472
data_type

0 commit comments

Comments
 (0)