JabariBooker commented on code in PR #12460:
URL: https://github.com/apache/arrow/pull/12460#discussion_r864355621


##########
cpp/src/arrow/compute/api_vector.h:
##########
@@ -188,6 +188,27 @@ class ARROW_EXPORT PartitionNthOptions : public 
FunctionOptions {
   NullPlacement null_placement;
 };
 
+/// \brief Options for cumulative sum function
+class ARROW_EXPORT CumulativeSumOptions : public FunctionOptions {
+ public:
+  explicit CumulativeSumOptions(double start = 0, bool skip_nulls = false,
+                                bool check_overflow = false);
+  explicit CumulativeSumOptions(std::shared_ptr<Scalar> start, bool skip_nulls 
= false,
+                                bool check_overflow = false);
+  static constexpr char const kTypeName[] = "CumulativeSumOptions";
+  static CumulativeSumOptions Defaults() { return CumulativeSumOptions(); }
+
+  /// Optional starting value for cumulative operation computation
+  std::shared_ptr<Scalar> start;
+
+  /// If true, nulls in the input are ignored and produce a corresponding null 
output.
+  /// When false, the first null encountered is propagated through the 
remaining output.
+  bool skip_nulls = false;
+
+  /// When true, returns an Invalid Status when overflow is detected
+  bool check_overflow = false;

Review Comment:
   This is inline with the existing scalar arithmetic functions that uses a 
`check_overflow` in a similar way. This can be changed, but then I wonder if 
the arithmetic functions should be changed in a separate issue.



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