kou commented on code in PR #37783:
URL: https://github.com/apache/arrow/pull/37783#discussion_r1330808121


##########
cpp/src/arrow/ipc/read_write_test.cc:
##########
@@ -1519,6 +1519,22 @@ class ReaderWriterMixin : public ExtensionTypesMixin {
     }
   }
 
+  void TestWriteAfterClose() {
+    // Part of GH-35095.
+    std::shared_ptr<RecordBatch> batch_ints;
+    ASSERT_OK(MakeIntRecordBatch(&batch_ints));
+
+    std::shared_ptr<Schema> schema = batch_ints->schema();

Review Comment:
   ```suggestion
       auto schema = batch_ints->schema();
   ```



##########
cpp/src/arrow/ipc/writer.cc:
##########
@@ -1070,6 +1070,9 @@ class ARROW_EXPORT IpcFormatWriter : public 
RecordBatchWriter {
   Status WriteRecordBatch(
       const RecordBatch& batch,
       const std::shared_ptr<const KeyValueMetadata>& custom_metadata) override 
{
+    if (closed_) {
+      return Status::Invalid("Destination already closed");
+    }

Review Comment:
   Thanks. I see.



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