| 1571 | namespace internal { |
| 1572 | |
| 1573 | Result<std::unique_ptr<RecordBatchWriter>> OpenRecordBatchWriter( |
| 1574 | std::unique_ptr<IpcPayloadWriter> sink, const std::shared_ptr<Schema>& schema, |
| 1575 | const IpcWriteOptions& options) { |
| 1576 | // constructor for IpcFormatWriter here dereferences ptr to schema. |
| 1577 | if (schema == nullptr) { |
| 1578 | return Status::Invalid("nullptr for Schema not allowed"); |
| 1579 | } |
| 1580 | auto writer = std::make_unique<internal::IpcFormatWriter>( |
| 1581 | std::move(sink), schema, options, /*is_file_format=*/false); |
| 1582 | RETURN_NOT_OK(writer->Start()); |
| 1583 | // R build with openSUSE155 requires an explicit unique_ptr construction |
| 1584 | return std::unique_ptr<RecordBatchWriter>(std::move(writer)); |
| 1585 | } |
| 1586 | |
| 1587 | Result<std::unique_ptr<IpcPayloadWriter>> MakePayloadStreamWriter( |
| 1588 | io::OutputStream* sink, const IpcWriteOptions& options) { |
no test coverage detected