| 1319 | |
| 1320 | |
| 1321 | void 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 | |
| 1347 | void Runner::createConnections() |
nothing calls this directly
no test coverage detected