niyue commented on code in PR #12812:
URL: https://github.com/apache/arrow/pull/12812#discussion_r853674205


##########
cpp/src/arrow/ipc/reader.cc:
##########
@@ -875,15 +894,31 @@ class RecordBatchStreamReaderImpl : public 
RecordBatchStreamReader {
     if (message == nullptr) {
       // End of stream
       *batch = nullptr;
+      if (custom_metadata != nullptr) {
+        *custom_metadata = nullptr;
+      }
       return Status::OK();
     }
 
     CHECK_HAS_BODY(*message);
     ARROW_ASSIGN_OR_RAISE(auto reader, Buffer::GetReader(message->body()));
     IpcReadContext context(&dictionary_memo_, options_, swap_endian_);
-    return ReadRecordBatchInternal(*message->metadata(), schema_, 
field_inclusion_mask_,
-                                   context, reader.get())
-        .Value(batch);
+    auto result = ReadRecordBatchInternal(*message->metadata(), schema_,
+                                          field_inclusion_mask_, context, 
reader.get());
+    if (result.ok()) {
+      auto batch_and_metadata = result.ValueOrDie();

Review Comment:
   After changing the API, I switch to use the `ARROW_ASSIGN_OR_RAISE` since it 
seems more common in the code.



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