mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 13:32:13 +00:00
35 lines
826 B
C++
35 lines
826 B
C++
#include <Parsers/ParserDescribeCacheQuery.h>
|
|
#include <Parsers/ASTDescribeCacheQuery.h>
|
|
#include <Parsers/CommonParsers.h>
|
|
#include <Parsers/ASTLiteral.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
|
|
bool ParserDescribeCacheQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
|
|
{
|
|
ParserKeyword p_describe("DESCRIBE");
|
|
ParserKeyword p_desc("DESC");
|
|
ParserKeyword p_cache("FILESYSTEM CACHE");
|
|
ParserLiteral p_cache_name;
|
|
|
|
if ((!p_describe.ignore(pos, expected) && !p_desc.ignore(pos, expected))
|
|
|| !p_cache.ignore(pos, expected))
|
|
return false;
|
|
|
|
auto query = std::make_shared<ASTDescribeCacheQuery>();
|
|
|
|
ASTPtr ast;
|
|
if (!p_cache_name.parse(pos, ast, expected))
|
|
return false;
|
|
|
|
query->cache_name = ast->as<ASTLiteral>()->value.safeGet<String>();
|
|
node = query;
|
|
|
|
return true;
|
|
}
|
|
|
|
|
|
}
|