js8544 commented on code in PR #36932:
URL: https://github.com/apache/arrow/pull/36932#discussion_r1288446127


##########
cpp/src/arrow/compute/kernels/vector_cumulative_ops.cc:
##########
@@ -217,53 +253,142 @@ const FunctionDoc cumulative_min_doc{
      "start as the new minimum)."),
     {"values"},
     "CumulativeOptions"};
+
+const FunctionDoc cumulative_mean_doc{
+    "Compute the cumulative mean over a numeric input",
+    ("`values` must be numeric. Return an array/chunked array which is the\n"
+     "cumulative mean computed over `values`. CumulativeOptions::start_value 
is \n"
+     "ignored."),
+    {"values"},
+    "CumulativeOptions"};
 }  // namespace
 
+// Kernel factory for simple arithmetic operations.
+// Op is a compute kernel representing any binary associative operation with
+// an identity element (add, product, min, max, etc.), i.e. ones that form a 
monoid.
+template <typename Op, typename OptionsType>
+struct CumulativeBinaryOpKernelFactory {

Review Comment:
   This unfortunately cannot be done easily.
   ```
   template <typename ArgType> State = CumulativeBinaryOp<Op, ArgType>
   ```
   This line won't work because `CumulativeBinaryOp<Op, ArgType>` is not a 
template anymore (both template parameters are fulfilled). We need to have some 
kind of currying mechanism for templates to make `CumulativeBinaryOp<Op, 
ArgType>` match `template <typename ArgType> State`. I'll really appreciate 
some help from a C++ metaprogramming expert :).



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