| 45 | public: |
| 46 | using FormatType = IpcFileFormat; |
| 47 | static Result<std::shared_ptr<Buffer>> Write(RecordBatchReader* reader) { |
| 48 | ARROW_ASSIGN_OR_RAISE(auto sink, io::BufferOutputStream::Create()); |
| 49 | ARROW_ASSIGN_OR_RAISE(auto writer, ipc::MakeFileWriter(sink, reader->schema())); |
| 50 | ARROW_ASSIGN_OR_RAISE(auto batches, reader->ToRecordBatches()); |
| 51 | for (auto batch : batches) { |
| 52 | RETURN_NOT_OK(writer->WriteRecordBatch(*batch)); |
| 53 | } |
| 54 | RETURN_NOT_OK(writer->Close()); |
| 55 | return sink->Finish(); |
| 56 | } |
| 57 | |
| 58 | static std::shared_ptr<IpcFileFormat> MakeFormat() { |
| 59 | return std::make_shared<IpcFileFormat>(); |
nothing calls this directly
no test coverage detected