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



##########
File path: cpp/src/arrow/compute/kernels/scalar_arithmetic.cc
##########
@@ -60,6 +68,42 @@ struct Add {
   }
 };
 
+struct AddChecked {
+#if __has_builtin(__builtin_add_overflow)
+  template <typename T>
+  static enable_if_integer<T> Call(KernelContext* ctx, T left, T right) {
+    T result;
+    if (__builtin_add_overflow(left, right, &result)) {
+      ctx->SetStatus(Status::Invalid("overflow"));

Review comment:
       Which error should we raise? ExecutionError?




----------------------------------------------------------------
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:
[email protected]


Reply via email to