felipecrv commented on code in PR #43190:
URL: https://github.com/apache/arrow/pull/43190#discussion_r1681052783


##########
cpp/src/arrow/array/concatenate.cc:
##########
@@ -75,6 +75,31 @@ struct Bitmap {
   bool AllSet() const { return data == nullptr; }
 };
 
+enum class OffsetBufferOpOutcome {
+  kOk,
+  kOffsetOverflow,
+};
+
+Status OffsetOverflowStatus() {
+  return Status::Invalid("offset overflow while concatenating arrays");
+}
+
+#define RETURN_IF_NOT_OK_OUTCOME(outcome)        \
+  switch (outcome) {                             \
+    case OffsetBufferOpOutcome::kOk:             \
+      break;                                     \
+    case OffsetBufferOpOutcome::kOffsetOverflow: \
+      return OffsetOverflowStatus();             \
+  }

Review Comment:
   The point of using a `switch` is to get compilation errors when a new enum 
case is added.



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