#include #include #include #include #include #include #include #include namespace DB { InterpreterCheckQuery::InterpreterCheckQuery(const ASTPtr & query_ptr_, const Context & context_) : query_ptr(query_ptr_), context(context_) { } BlockIO InterpreterCheckQuery::execute() { const auto * alter = query_ptr->as(); const String & table_name = alter->table; String database_name = alter->database.empty() ? context.getCurrentDatabase() : alter->database; StoragePtr table = context.getTable(database_name, table_name); auto column = ColumnUInt8::create(); column->insertValue(UInt64(table->checkData())); result = Block{{ std::move(column), std::make_shared(), "result" }}; BlockIO res; res.in = std::make_shared(result); return res; } }