Skip to content

Commit 83f4e7f

Browse files
committed
hashtable_with_count_vector_approach
1 parent 8d76cab commit 83f4e7f

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
@@ -371,7 +371,7 @@ impl AggregateUDFImpl for Count {
371371
if !args.is_distinct {
372372
return Ok(Box::new(CountGroupsAccumulator::new()));
373373
}
374-
create_distinct_count_groups_accumulator(args)
374+
create_distinct_count_groups_accumulator(&args)
375375
}
376376

377377
fn reverse_expr(&self) -> ReversedUDAF {
@@ -446,34 +446,34 @@ impl AggregateUDFImpl for Count {
446446

447447
#[cold]
448448
fn create_distinct_count_groups_accumulator(
449-
args: AccumulatorArgs,
449+
args: &AccumulatorArgs,
450450
) -> Result<Box<dyn GroupsAccumulator>> {
451451
let data_type = args.expr_fields[0].data_type();
452452
match data_type {
453453
DataType::Int8 => Ok(Box::new(
454454
PrimitiveDistinctCountGroupsAccumulator::<Int8Type>::new(),
455455
)),
456-
DataType::Int16 => Ok(Box::new(
457-
PrimitiveDistinctCountGroupsAccumulator::<Int16Type>::new(),
458-
)),
459-
DataType::Int32 => Ok(Box::new(
460-
PrimitiveDistinctCountGroupsAccumulator::<Int32Type>::new(),
461-
)),
462-
DataType::Int64 => Ok(Box::new(
463-
PrimitiveDistinctCountGroupsAccumulator::<Int64Type>::new(),
464-
)),
465-
DataType::UInt8 => Ok(Box::new(
466-
PrimitiveDistinctCountGroupsAccumulator::<UInt8Type>::new(),
467-
)),
468-
DataType::UInt16 => Ok(Box::new(
469-
PrimitiveDistinctCountGroupsAccumulator::<UInt16Type>::new(),
470-
)),
471-
DataType::UInt32 => Ok(Box::new(
472-
PrimitiveDistinctCountGroupsAccumulator::<UInt32Type>::new(),
473-
)),
474-
DataType::UInt64 => Ok(Box::new(
475-
PrimitiveDistinctCountGroupsAccumulator::<UInt64Type>::new(),
476-
)),
456+
DataType::Int16 => Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<
457+
Int16Type,
458+
>::new())),
459+
DataType::Int32 => Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<
460+
Int32Type,
461+
>::new())),
462+
DataType::Int64 => Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<
463+
Int64Type,
464+
>::new())),
465+
DataType::UInt8 => Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<
466+
UInt8Type,
467+
>::new())),
468+
DataType::UInt16 => Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<
469+
UInt16Type,
470+
>::new())),
471+
DataType::UInt32 => Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<
472+
UInt32Type,
473+
>::new())),
474+
DataType::UInt64 => Ok(Box::new(PrimitiveDistinctCountGroupsAccumulator::<
475+
UInt64Type,
476+
>::new())),
477477
_ => not_impl_err!(
478478
"GroupsAccumulator not supported for COUNT(DISTINCT) with {}",
479479
data_type

0 commit comments

Comments
 (0)