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 2022/02/02 08:00:39 UTC

[GitHub] [arrow] Crystrix commented on a change in pull request #12299: ARROW-15506: [C++][Compute] Support Null type in hash_sum/hash_product/hash_mean

Crystrix commented on a change in pull request #12299:
URL: https://github.com/apache/arrow/pull/12299#discussion_r797348794



##########
File path: cpp/src/arrow/compute/kernels/hash_aggregate.cc
##########
@@ -1091,8 +1153,17 @@ struct GroupedMeanImpl : public GroupedReducingAggregator<Type, GroupedMeanImpl<
   }
 };
 
+struct GroupedMeanNullImpl final : public GroupedNullImpl {
+  std::shared_ptr<DataType> out_type() const override { return float64(); }
+
+  void output_empty(const std::shared_ptr<Buffer>& data) override {
+    std::memset(data->mutable_data(), 0, num_groups_ * sizeof(double));

Review comment:
       @pitrou, `memset` is replaced with `fill_n`.




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org