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

comphead pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new 3fc99de9c0 Minor: improve GroupsAccumulator docs (#12501)
3fc99de9c0 is described below

commit 3fc99de9c0ed9b0d4debde82f013e4df68562441
Author: Andrew Lamb <[email protected]>
AuthorDate: Tue Sep 17 11:17:17 2024 -0400

    Minor: improve GroupsAccumulator docs (#12501)
---
 datafusion/expr-common/src/groups_accumulator.rs | 25 +++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/datafusion/expr-common/src/groups_accumulator.rs 
b/datafusion/expr-common/src/groups_accumulator.rs
index 156e21d9ae..8e81c51d84 100644
--- a/datafusion/expr-common/src/groups_accumulator.rs
+++ b/datafusion/expr-common/src/groups_accumulator.rs
@@ -56,9 +56,32 @@ impl EmitTo {
     }
 }
 
-/// `GroupAccumulator` implements a single aggregate (e.g. AVG) and
+/// `GroupsAccumulator` implements a single aggregate (e.g. AVG) and
 /// stores the state for *all* groups internally.
 ///
+/// Logically, a [`GroupsAccumulator`] stores a mapping from each group index 
to
+/// the state of the aggregate for that group. For example an implementation 
for
+/// `min` might look like
+///
+/// ```text
+///    ┌─────┐
+///    │  0  │───────────▶   100
+///    ├─────┤
+///    │  1  │───────────▶   200
+///    └─────┘
+///      ...                 ...
+///    ┌─────┐
+///    │ N-2 │───────────▶    50
+///    ├─────┤
+///    │ N-1 │───────────▶   200
+///    └─────┘
+///
+///
+///  Logical group      Current Min
+///     number          value for that
+///                     group
+/// ```
+///
 /// # Notes on Implementing `GroupAccumulator`
 ///
 /// All aggregates must first implement the simpler [`Accumulator`] trait, 
which


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to