MCPcopy Create free account
hub / github.com/bytedance/bolt / writeToFile

Function writeToFile

bolt/exec/fuzzer/PrestoQueryRunner.cpp:60–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60void 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
81std::unique_ptr<ByteInputStream> toByteStream(const std::string& input) {
82 std::vector<ByteRange> ranges;

Callers 1

executeVectorMethod · 0.70

Calls 6

getWriterFactoryFunction · 0.85
sizeMethod · 0.45
typeMethod · 0.45
createWriterMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected