js8544 commented on code in PR #36020:
URL: https://github.com/apache/arrow/pull/36020#discussion_r1237274608
##########
cpp/src/arrow/compute/kernels/vector_cumulative_ops.cc:
##########
@@ -160,18 +169,52 @@ const FunctionDoc cumulative_sum_doc{
("`values` must be numeric. Return an array/chunked array which is the\n"
"cumulative sum computed over `values`. Results will wrap around on\n"
"integer overflow. Use function \"cumulative_sum_checked\" if you want\n"
- "overflow to return an error."),
+ "overflow to return an error. The default start is 0."),
{"values"},
- "CumulativeSumOptions"};
+ "CumulativeOptions"};
const FunctionDoc cumulative_sum_checked_doc{
"Compute the cumulative sum over a numeric input",
("`values` must be numeric. Return an array/chunked array which is the\n"
"cumulative sum computed over `values`. This function returns an error\n"
"on overflow. For a variant that doesn't fail on overflow, use\n"
- "function \"cumulative_sum\"."),
+ "function \"cumulative_sum\". The default start is 0."),
+ {"values"},
+ "CumulativeOptions"};
+
+const FunctionDoc cumulative_prod_doc{
+ "Compute the cumulative product over a numeric input",
+ ("`values` must be numeric. Return an array/chunked array which is the\n"
+ "cumulative product computed over `values`. Results will wrap around on\n"
+ "integer overflow. Use function \"cumulative_prod_checked\" if you want\n"
+ "overflow to return an error. The default start is 1."),
+ {"values"},
+ "CumulativeOptions"};
+
+const FunctionDoc cumulative_prod_checked_doc{
+ "Compute the cumulative product over a numeric input",
+ ("`values` must be numeric. Return an array/chunked array which is the\n"
+ "cumulative product computed over `values`. This function returns an
error\n"
+ "on overflow. For a variant that doesn't fail on overflow, use\n"
+ "function \"cumulative_prod\". The default start is 1."),
+ {"values"},
+ "CumulativeOptions"};
+
+const FunctionDoc cumulative_max_doc{
+ "Compute the cumulative max over a numeric input",
+ ("`values` must be numeric. Return an array/chunked array which is the\n"
+ "cumulative max computed over `values`. The default start is the
minimum\n"
+ "value of input type."),
{"values"},
- "CumulativeSumOptions"};
+ "CumulativeOptions"};
+
+const FunctionDoc cumulative_min_doc{
+ "Compute the cumulative min over a numeric input",
+ ("`values` must be numeric. Return an array/chunked array which is the\n"
+ "cumulative min computed over `values`. The default start is the
maximum\n"
+ "value of input type."),
Review Comment:
```suggestion
"value of input type."),
"value of input type (so that any other value will replace the\n
"start as the new minimum)."),
```
--
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]