| 872 | } |
| 873 | |
| 874 | Status WriteRecordBatchStream(const std::vector<std::shared_ptr<RecordBatch>>& batches, |
| 875 | const IpcWriteOptions& options, io::OutputStream* dst) { |
| 876 | ARROW_ASSIGN_OR_RAISE(std::shared_ptr<RecordBatchWriter> writer, |
| 877 | MakeStreamWriter(dst, batches[0]->schema(), options)); |
| 878 | for (const auto& batch : batches) { |
| 879 | DCHECK(batch->schema()->Equals(*batches[0]->schema())) << "Schemas unequal"; |
| 880 | RETURN_NOT_OK(writer->WriteRecordBatch(*batch)); |
| 881 | } |
| 882 | RETURN_NOT_OK(writer->Close()); |
| 883 | return Status::OK(); |
| 884 | } |
| 885 | |
| 886 | namespace { |
| 887 | |