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