#include #include #include #include #include #include #include #include #include #include namespace DB { BlockIO InterpreterExistsQuery::execute() { BlockIO res; res.in = executeImpl(); return res; } BlockInputStreamPtr InterpreterExistsQuery::executeImpl() { const ASTExistsQuery & ast = typeid_cast(*query_ptr); bool res = context.isTableExist(ast.database, ast.table); return std::make_shared(Block{{ ColumnUInt8::create(1, res), std::make_shared(), "result" }}); } }