| 58 | } |
| 59 | |
| 60 | void writeToFile( |
| 61 | const std::string& path, |
| 62 | const std::vector<RowVectorPtr>& data, |
| 63 | memory::MemoryPool* pool) { |
| 64 | BOLT_CHECK_GT(data.size(), 0); |
| 65 | |
| 66 | dwio::common::WriterOptions options; |
| 67 | options.schema = data[0]->type(); |
| 68 | options.memoryPool = pool; |
| 69 | |
| 70 | auto writeFile = std::make_unique<LocalWriteFile>(path, true, false); |
| 71 | auto sink = |
| 72 | std::make_unique<dwio::common::WriteFileSink>(std::move(writeFile), path); |
| 73 | auto writer = dwio::common::getWriterFactory(dwio::common::FileFormat::DWRF) |
| 74 | ->createWriter(std::move(sink), options); |
| 75 | for (const auto& vector : data) { |
| 76 | writer->write(vector); |
| 77 | } |
| 78 | writer->close(); |
| 79 | } |
| 80 | |
| 81 | std::unique_ptr<ByteInputStream> toByteStream(const std::string& input) { |
| 82 | std::vector<ByteRange> ranges; |
no test coverage detected