You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/08/13 12:32:08 UTC
(datafusion) branch gh-readonly-queue/main/pr-24309-ab12f5e4be594e7287602dd0d60381d971a9389a created (now 1164d60221)
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a change to branch gh-readonly-queue/main/pr-24309-ab12f5e4be594e7287602dd0d60381d971a9389a
in repository https://gitbox.apache.org/repos/asf/datafusion.git
at 1164d60221 Minor: avoid a few clones in sum accumulator setup (#24309)
This branch includes the following new commits:
new 1164d60221 Minor: avoid a few clones in sum accumulator setup (#24309)
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org
(datafusion) 01/01: Minor: avoid a few clones in sum accumulator setup (#24309)
Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-24309-ab12f5e4be594e7287602dd0d60381d971a9389a
in repository https://gitbox.apache.org/repos/asf/datafusion.git
commit 1164d6022144f4289bdc450eeff3efdec70452c2
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Thu Aug 13 12:31:44 2026 +0000
Minor: avoid a few clones in sum accumulator setup (#24309)
## Which issue does this PR close?
- follow on to https://github.com/apache/datafusion/pull/24035
## Rationale for this change
This is a minor thing I found while doing some performance profiling for
https://github.com/apache/datafusion/pull/24035
## What changes are included in this PR?
Avoid a few clone calls
## Are these changes tested?
By CI
## Are there any user-facing changes?
realistically nothing that someone will measure
---
.../functions-aggregate-common/src/aggregate/avg_distinct/decimal.rs | 2 +-
.../functions-aggregate-common/src/aggregate/avg_distinct/numeric.rs | 2 +-
.../functions-aggregate-common/src/aggregate/sum_distinct/numeric.rs | 4 ++--
datafusion/functions-aggregate/src/sum.rs | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/datafusion/functions-aggregate-common/src/aggregate/avg_distinct/decimal.rs b/datafusion/functions-aggregate-common/src/aggregate/avg_distinct/decimal.rs
index 0394a8391a..1b2fb01189 100644
--- a/datafusion/functions-aggregate-common/src/aggregate/avg_distinct/decimal.rs
+++ b/datafusion/functions-aggregate-common/src/aggregate/avg_distinct/decimal.rs
@@ -56,7 +56,7 @@ impl<I: DecimalType + Debug, S: DecimalType + Debug> DecimalDistinctAvgAccumulat
let data_type = I::TYPE_CONSTRUCTOR(I::MAX_PRECISION, sum_scale);
Self {
- sum_accumulator: DistinctSumAccumulator::new(&data_type),
+ sum_accumulator: DistinctSumAccumulator::new(data_type),
sum_scale,
target_precision,
target_scale,
diff --git a/datafusion/functions-aggregate-common/src/aggregate/avg_distinct/numeric.rs b/datafusion/functions-aggregate-common/src/aggregate/avg_distinct/numeric.rs
index bb43acc261..8f2cb32637 100644
--- a/datafusion/functions-aggregate-common/src/aggregate/avg_distinct/numeric.rs
+++ b/datafusion/functions-aggregate-common/src/aggregate/avg_distinct/numeric.rs
@@ -36,7 +36,7 @@ impl Default for Float64DistinctAvgAccumulator {
fn default() -> Self {
Self {
sum_accumulator: DistinctSumAccumulator::<Float64Type>::new(
- &DataType::Float64,
+ DataType::Float64,
),
}
}
diff --git a/datafusion/functions-aggregate-common/src/aggregate/sum_distinct/numeric.rs b/datafusion/functions-aggregate-common/src/aggregate/sum_distinct/numeric.rs
index 2119c06b48..93a320edb5 100644
--- a/datafusion/functions-aggregate-common/src/aggregate/sum_distinct/numeric.rs
+++ b/datafusion/functions-aggregate-common/src/aggregate/sum_distinct/numeric.rs
@@ -40,10 +40,10 @@ pub struct DistinctSumAccumulator<T: ArrowPrimitiveType> {
}
impl<T: ArrowPrimitiveType> DistinctSumAccumulator<T> {
- pub fn new(data_type: &DataType) -> Self {
+ pub fn new(data_type: DataType) -> Self {
Self {
values: GenericDistinctBuffer::new(data_type.clone()),
- data_type: data_type.clone(),
+ data_type,
}
}
diff --git a/datafusion/functions-aggregate/src/sum.rs b/datafusion/functions-aggregate/src/sum.rs
index 71932c5f0b..20bfe064e5 100644
--- a/datafusion/functions-aggregate/src/sum.rs
+++ b/datafusion/functions-aggregate/src/sum.rs
@@ -264,14 +264,14 @@ impl AggregateUDFImpl for Sum {
if args.is_distinct {
macro_rules! helper {
($t:ty, $dt:expr) => {
- Ok(Box::new(DistinctSumAccumulator::<$t>::new(&$dt)))
+ Ok(Box::new(DistinctSumAccumulator::<$t>::new($dt)))
};
}
downcast_sum!(args, helper)
} else {
macro_rules! helper {
($t:ty, $dt:expr) => {
- Ok(Box::new(SumAccumulator::<$t>::new($dt.clone())))
+ Ok(Box::new(SumAccumulator::<$t>::new($dt)))
};
}
downcast_sum!(args, helper)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org