alamb commented on code in PR #2375:
URL: https://github.com/apache/arrow-datafusion/pull/2375#discussion_r867487069
##########
datafusion/physical-expr/src/aggregate/sum.rs:
##########
@@ -338,6 +455,42 @@ impl Accumulator for SumAccumulator {
}
}
+#[derive(Debug)]
+struct SumAccumulatorV2 {
+ index: usize,
+ datatype: DataType,
+}
+
+impl SumAccumulatorV2 {
+ pub fn new(index: usize, datatype: DataType) -> Self {
+ Self { index, datatype }
+ }
+}
+
+impl AccumulatorV2 for SumAccumulatorV2 {
+ fn update_batch(
+ &mut self,
+ values: &[ArrayRef],
+ accessor: &mut RowAccessor,
+ ) -> Result<()> {
+ let values = &values[0];
+ add_to_row(&self.datatype, self.index, accessor, &sum_batch(values)?)?;
Review Comment:
Also, possibly related https://github.com/apache/arrow-datafusion/issues/2447
--
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]