alamb commented on code in PR #6904:
URL: https://github.com/apache/arrow-datafusion/pull/6904#discussion_r1258775045


##########
datafusion/physical-expr/src/aggregate/sum.rs:
##########
@@ -465,6 +518,114 @@ impl RowAccumulator for SumRowAccumulator {
     }
 }
 
+/// An accumulator to compute the sum of values in [`PrimitiveArray<T>`]
+#[derive(Debug)]
+struct SumGroupsAccumulator<T>
+where
+    T: ArrowNumericType + Send,
+{
+    /// The type of the computed sum
+    sum_data_type: DataType,
+
+    /// The type of the returned sum
+    return_data_type: DataType,
+
+    /// Sums per group, stored as the native type
+    sums: Vec<T::Native>,
+
+    /// Track nulls in the input / filters
+    null_state: NullState,
+}
+
+impl<T> SumGroupsAccumulator<T>

Review Comment:
   That is a great suggestion -- I did it in e4a52f9ff5 and deleted a bunch of 
duplication



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to