MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / writeOutputString

Method writeOutputString

programs/keeper-bench/Runner.cpp:1321–1344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1319
1320
1321void Runner::writeOutputString(const std::string & output_string, int64_t start_timestamp_ms)
1322{
1323 if (print_to_stdout)
1324 std::cout << output_string << std::endl;
1325
1326 if (file_output)
1327 {
1328 auto path = *file_output;
1329
1330 if (output_file_with_timestamp)
1331 {
1332 auto filename = file_output->filename();
1333 filename = fmt::format("{}_{}{}", filename.stem().generic_string(), start_timestamp_ms, filename.extension().generic_string());
1334 path = file_output->parent_path() / filename;
1335 }
1336
1337 std::cerr << "Storing output to " << fs::absolute(path) << std::endl;
1338
1339 DB::WriteBufferFromFile file_output_buffer(path);
1340 DB::ReadBufferFromString read_buffer(output_string);
1341 DB::copyData(read_buffer, file_output_buffer);
1342 file_output_buffer.finalize();
1343 }
1344}
1345
1346
1347void Runner::createConnections()

Callers

nothing calls this directly

Calls 5

copyDataFunction · 0.85
stemMethod · 0.80
parent_pathMethod · 0.80
formatFunction · 0.50
finalizeMethod · 0.45

Tested by

no test coverage detected