#include #include #include #include #include #include #include #include #include #include #include namespace DB { namespace { Block getResultRow(const std::optional & info) { auto column_uuid = ColumnUUID::create(); auto column_backup_name = ColumnString::create(); auto column_status = ColumnInt8::create(); if (info) { column_uuid->insert(info->uuid); column_backup_name->insert(info->backup_name); column_status->insert(static_cast(info->status)); } Block res_columns; res_columns.insert(0, {std::move(column_uuid), std::make_shared(), "uuid"}); res_columns.insert(1, {std::move(column_backup_name), std::make_shared(), "backup_name"}); res_columns.insert(2, {std::move(column_status), std::make_shared(getBackupStatusEnumValues()), "status"}); return res_columns; } } BlockIO InterpreterBackupQuery::execute() { auto & backups_worker = context->getBackupsWorker(); auto [uuid, internal] = backups_worker.start(query_ptr, context); BlockIO res_io; res_io.pipeline = QueryPipeline(std::make_shared(getResultRow(backups_worker.tryGetInfo(uuid, internal)))); return res_io; } }