| 39 | public: |
| 40 | using FormatType = OrcFileFormat; |
| 41 | static Result<std::shared_ptr<Buffer>> Write(RecordBatchReader* reader) { |
| 42 | ARROW_ASSIGN_OR_RAISE(auto sink, io::BufferOutputStream::Create()); |
| 43 | ARROW_ASSIGN_OR_RAISE(auto writer, adapters::orc::ORCFileWriter::Open(sink.get())); |
| 44 | ARROW_ASSIGN_OR_RAISE(auto table, reader->ToTable()); |
| 45 | RETURN_NOT_OK(writer->Write(*table)); |
| 46 | RETURN_NOT_OK(writer->Close()); |
| 47 | return sink->Finish(); |
| 48 | } |
| 49 | |
| 50 | static std::shared_ptr<OrcFileFormat> MakeFormat() { |
| 51 | return std::make_shared<OrcFileFormat>(); |