| 860 | } |
| 861 | |
| 862 | Status WriteRecordBatchStream(const std::vector<std::shared_ptr<RecordBatch>>& batches, |
| 863 | const IpcWriteOptions& options, io::OutputStream* dst) { |
| 864 | ARROW_ASSIGN_OR_RAISE(std::shared_ptr<RecordBatchWriter> writer, |
| 865 | MakeStreamWriter(dst, batches[0]->schema(), options)); |
| 866 | for (const auto& batch : batches) { |
| 867 | DCHECK(batch->schema()->Equals(*batches[0]->schema())) << "Schemas unequal"; |
| 868 | RETURN_NOT_OK(writer->WriteRecordBatch(*batch)); |
| 869 | } |
| 870 | RETURN_NOT_OK(writer->Close()); |
| 871 | return Status::OK(); |
| 872 | } |
| 873 | |
| 874 | namespace { |
| 875 | |