| 208 | } |
| 209 | |
| 210 | Result<std::shared_ptr<FileWriter>> IpcFileFormat::MakeWriter( |
| 211 | std::shared_ptr<io::OutputStream> destination, std::shared_ptr<Schema> schema, |
| 212 | std::shared_ptr<FileWriteOptions> options, |
| 213 | fs::FileLocator destination_locator) const { |
| 214 | if (!Equals(*options->format())) { |
| 215 | return Status::TypeError("Mismatching format/write options."); |
| 216 | } |
| 217 | |
| 218 | auto ipc_options = checked_pointer_cast<IpcFileWriteOptions>(options); |
| 219 | |
| 220 | ARROW_ASSIGN_OR_RAISE(auto writer, |
| 221 | ipc::MakeFileWriter(destination, schema, *ipc_options->options, |
| 222 | ipc_options->metadata)); |
| 223 | |
| 224 | return std::shared_ptr<FileWriter>( |
| 225 | new IpcFileWriter(std::move(destination), std::move(writer), std::move(schema), |
| 226 | std::move(ipc_options), std::move(destination_locator))); |
| 227 | } |
| 228 | |
| 229 | IpcFileWriter::IpcFileWriter(std::shared_ptr<io::OutputStream> destination, |
| 230 | std::shared_ptr<ipc::RecordBatchWriter> writer, |