You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by ad...@apache.org on 2026/09/08 12:37:09 UTC

(datafusion) 01/02: Take slices in rewrite_pays_for_count

This is an automated email from the ASF dual-hosted git repository.

adriangb pushed a commit to branch claude/single-distinct-to-groupby-allow-count
in repository https://gitbox.apache.org/repos/asf/datafusion.git

commit 1538e416178de41749eba5477651be61b65a69d8
Author: Adrian Garcia Badaracco <17...@users.noreply.github.com>
AuthorDate: Tue Sep 8 07:34:31 2026 -0500

    Take slices in rewrite_pays_for_count
    
    The helper never needs the `Vec`, and the surrounding APIs pass slices.
    No behaviour change.
    
    Co-Authored-By: Claude Opus 5 <no...@anthropic.com>
---
 datafusion/optimizer/src/single_distinct_to_groupby.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/datafusion/optimizer/src/single_distinct_to_groupby.rs b/datafusion/optimizer/src/single_distinct_to_groupby.rs
index 171ffaa431..f7f9c02c49 100644
--- a/datafusion/optimizer/src/single_distinct_to_groupby.rs
+++ b/datafusion/optimizer/src/single_distinct_to_groupby.rs
@@ -157,7 +157,7 @@ fn is_single_distinct_agg(
                 for e in args {
                     fields_set.insert(e);
                 }
-                distinct_aggs.push((func, args));
+                distinct_aggs.push((func, args.as_slice()));
             } else if count_rollup.is_some_and(|rollup| rollup.is_count(func)) {
                 has_count_rollup = true;
             } else if func.name() != "sum"
@@ -209,7 +209,7 @@ fn is_single_distinct_agg(
 /// and is left alone: narrowing it would change plans that have always been
 /// rewritten, which no measurement here calls for.
 fn rewrite_pays_for_count(
-    distinct_aggs: &[(&Arc<AggregateUDF>, &Vec<Expr>)],
+    distinct_aggs: &[(&Arc<AggregateUDF>, &[Expr])],
     input_schema: &DFSchema,
 ) -> Result<bool> {
     for (func, args) in distinct_aggs {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org