You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/01/31 13:49:09 UTC

[GitHub] [arrow] Dandandan commented on a change in pull request #9380: ARROW-11444: [Rust][DataFusion] Accept slices as parameters

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:
users@infra.apache.org