| 1639 | } |
| 1640 | |
| 1641 | Result<std::shared_ptr<Buffer>> SerializeSchema(const Schema& schema, MemoryPool* pool) { |
| 1642 | ARROW_ASSIGN_OR_RAISE(auto stream, io::BufferOutputStream::Create(1024, pool)); |
| 1643 | |
| 1644 | auto options = IpcWriteOptions::Defaults(); |
| 1645 | const bool is_file_format = false; // indifferent as we don't write dictionaries |
| 1646 | internal::IpcFormatWriter writer( |
| 1647 | std::make_unique<internal::PayloadStreamWriter>(stream.get()), schema, options, |
| 1648 | is_file_format); |
| 1649 | RETURN_NOT_OK(writer.Start()); |
| 1650 | return stream->Finish(); |
| 1651 | } |
| 1652 | |
| 1653 | } // namespace ipc |
| 1654 | } // namespace arrow |