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 2020/06/18 13:40:03 UTC

[GitHub] [arrow] kszucs commented on a change in pull request #7478: ARROW-9055: [C++] Add sum/mean kernels for Boolean type

kszucs commented on a change in pull request #7478:
URL: https://github.com/apache/arrow/pull/7478#discussion_r442233159



##########
File path: cpp/src/arrow/compute/kernels/aggregate_basic.cc
##########
@@ -255,6 +255,28 @@ struct SumState {
   }
 };
 
+template <>
+struct SumState<BooleanType> {
+  using SumType = typename FindAccumulatorType<BooleanType>::Type;
+  using ThisType = SumState<BooleanType, SumType>;
+
+  ThisType& operator+=(const ThisType& rhs) {

Review comment:
       I chose to specialize SumState since the required machinery is already implemented. 
   
   I could factor out the common parts to a SumStateBase or something. Let me know if there is a nicer solution.




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