Dandandan commented on a change in pull request #9380:
URL: https://github.com/apache/arrow/pull/9380#discussion_r567429222



##########
File path: rust/datafusion/src/physical_plan/hash_aggregate.rs
##########
@@ -734,16 +734,10 @@ fn aggregate_batch(
 
             // 1.3
             match mode {
-                AggregateMode::Partial => {
-                    accum.update_batch(values)?;
-                }
-                AggregateMode::Final => {
-                    accum.merge_batch(values)?;
-                }
+                AggregateMode::Partial => accum.update_batch(values),
+                AggregateMode::Final => accum.merge_batch(values),
             }
-            Ok(accum)
         })
-        .collect::<Result<Vec<_>>>()

Review comment:
       Small cleanup here, to not collect it needlessly into a vec (as it is 
the same as the input anyway, and it mutates the accumulators, so it's more 
clear and slightly more efficient now).




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

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


Reply via email to