ClickHouse/dbms/src/Interpreters/InterpreterExistsQuery.h

31 lines
645 B
C++
Raw Normal View History

#pragma once
#include <Interpreters/Context.h>
#include <Interpreters/IInterpreter.h>
namespace DB
{
/** Проверить, существует ли таблица. Вернуть одну строку с одним столбцом result типа UInt8 со значением 0 или 1.
*/
2015-06-18 02:11:05 +00:00
class InterpreterExistsQuery : public IInterpreter
{
public:
InterpreterExistsQuery(ASTPtr query_ptr_, Context & context_)
: query_ptr(query_ptr_), context(context_) {}
BlockIO execute() override;
private:
ASTPtr query_ptr;
Context context;
Block getSampleBlock();
BlockInputStreamPtr executeImpl();
};
}