| 1661 | } |
| 1662 | |
| 1663 | Result<std::shared_ptr<Buffer>> SerializeSchema(const Schema& schema, MemoryPool* pool) { |
| 1664 | ARROW_ASSIGN_OR_RAISE(auto stream, io::BufferOutputStream::Create(1024, pool)); |
| 1665 | |
| 1666 | auto options = IpcWriteOptions::Defaults(); |
| 1667 | const bool is_file_format = false; // indifferent as we don't write dictionaries |
| 1668 | internal::IpcFormatWriter writer( |
| 1669 | std::make_unique<internal::PayloadStreamWriter>(stream.get()), schema, options, |
| 1670 | is_file_format); |
| 1671 | RETURN_NOT_OK(writer.Start()); |
| 1672 | return stream->Finish(); |
| 1673 | } |
| 1674 | |
| 1675 | } // namespace ipc |
| 1676 | } // namespace arrow |