Skip to content

Commit 7b49bf0

Browse files
committed
count group benchmark check
1 parent c19ce16 commit 7b49bf0

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ where
4747
num_groups: 0,
4848
}
4949
}
50-
5150
}
5251

5352
impl<T: ArrowPrimitiveType> Default for PrimitiveDistinctCountGroupsAccumulator<T>

datafusion/functions-aggregate/benches/count_distinct.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,13 @@ fn count_distinct_groups_benchmark(c: &mut Criterion) {
198198
b.iter(|| {
199199
let (_schema, args) = prepare_args(DataType::Int64);
200200
let mut acc = count_fn.create_groups_accumulator(args).unwrap();
201-
acc.update_batch(&[values.clone()], &group_indices, None, num_groups)
202-
.unwrap();
201+
acc.update_batch(
202+
&[values.clone()],
203+
&group_indices,
204+
None,
205+
num_groups,
206+
)
207+
.unwrap();
203208
acc.evaluate(EmitTo::All).unwrap()
204209
})
205210
},
@@ -216,7 +221,9 @@ fn count_distinct_groups_benchmark(c: &mut Criterion) {
216221
let arr = values.as_any().downcast_ref::<Int64Array>().unwrap();
217222
for (idx, group_idx) in group_indices.iter().enumerate() {
218223
if let Some(val) = arr.value(idx).into() {
219-
let single_val = Arc::new(Int64Array::from(vec![Some(val)])) as ArrayRef;
224+
let single_val =
225+
Arc::new(Int64Array::from(vec![Some(val)]))
226+
as ArrayRef;
220227
accumulators[*group_idx]
221228
.update_batch(std::slice::from_ref(&single_val))
222229
.unwrap();
@@ -234,5 +241,9 @@ fn count_distinct_groups_benchmark(c: &mut Criterion) {
234241
}
235242
}
236243

237-
criterion_group!(benches, count_distinct_benchmark, count_distinct_groups_benchmark);
244+
criterion_group!(
245+
benches,
246+
count_distinct_benchmark,
247+
count_distinct_groups_benchmark
248+
);
238249
criterion_main!(benches);

0 commit comments

Comments
 (0)