jayzhan211 commented on code in PR #7242:
URL: https://github.com/apache/arrow-datafusion/pull/7242#discussion_r1292887025


##########
datafusion/core/src/physical_plan/aggregates/mod.rs:
##########
@@ -1128,10 +1128,18 @@ fn finalize_aggregation(
         | AggregateMode::Single
         | AggregateMode::SinglePartitioned => {
             // merge the state to the final value
-            accumulators
+            let res = accumulators
                 .iter()
-                .map(|accumulator| accumulator.evaluate().map(|v| 
v.to_array()))
-                .collect::<Result<Vec<ArrayRef>>>()
+                .map(|accumulator| {
+                    let column_value = accumulator.evaluate_v2();

Review Comment:
   @alamb 
   If we want `accumulator.evaluate()` here, we might need to introduce 
something like `ScalarValue::Array(Option<Vec<ScalarValue>>)`, the `Vec` here 
is to represent values of rows.
   
   i.e. ScalarValue::Array(vec![1, 2, 3, 4])
   -> Int64Array(1,2,3,4), which is a `four-row` value with (1,2,3,4).
   
   With ScalarValue::List(vec![1,2,3,4])
   I would get ListArray(Int64Array(1,2,3,4)), which is the`one-row` value with 
list[1,2,3,4].



-- 
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