ianmcook commented on code in PR #12460:
URL: https://github.com/apache/arrow/pull/12460#discussion_r857784193
##########
docs/source/cpp/compute.rst:
##########
@@ -1546,6 +1546,30 @@ random generator.
Array-wise ("vector") functions
-------------------------------
+Cumulative Functions
+~~~~~~~~~~~~~~~~~~~~
+
+Cumulative functions are vector functions that perform a running total on their
+input using an given binary associatve operation and output an array containing
+the corresponding intermediate running values. The input is expected to be of
+numeric type. By default these functions do not detect overflow. They are also
+available in an overflow-checking variant, suffixed ``_checked``, which returns
+an ``Invalid`` :class:`Status` when overflow is detected.
+
++------------------------+-------+-------------+-------------+--------------------------------+-------+
+| Function name | Arity | Input types | Output type | Options class
| Notes |
++========================+=======+=============+=============+================================+=======+
+| cumulative_sum | Unary | Numeric | Numeric |
:struct:`CumulativeSumOptions` | \(1) |
++------------------------+-------+-------------+-------------+--------------------------------+-------+
+| cumulative_sum_checked | Unary | Numeric | Numeric |
:struct:`CumulativeSumOptions` | \(1) |
++------------------------+-------+-------------+-------------+--------------------------------+-------+
+
+* \(1) CumulativeSumOptions has two optional parameters. The first is
+ :member:`CumulativeSumOptions::start`, which is an optional starting value
for
+ the running sum with the same type as the input. start has and default value
+ of 0. The second parameter is :member:`CumulativeSumOptions::skip_nulls`,
which
+ is a boolean that when set to false, the first encountered null is
propagated.
Review Comment:
```suggestion
* \(1) CumulativeSumOptions has two optional parameters. The first parameter
:member:`CumulativeSumOptions::start` is a starting value for the running
sum. It has a default value of 0. Specified values of ``start`` must have
the
same type as the input. The second parameter
:member:`CumulativeSumOptions::skip_nulls` is a boolean. When set to
false (the default), the first encountered null is propagated. When set to
true, each null in the input produces a corresponding null in the output.
```
--
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]