diff --git a/src/Parsers/ASTDescribeCacheQuery.cpp b/src/Parsers/ASTDescribeCacheQuery.cpp new file mode 100644 index 00000000000..6daedfdb3a4 --- /dev/null +++ b/src/Parsers/ASTDescribeCacheQuery.cpp @@ -0,0 +1,23 @@ +#include +#include + + +namespace DB +{ + +String ASTDescribeCacheQuery::getID(char) const { return "DescribeCacheQuery"; } + +ASTPtr ASTDescribeCacheQuery::clone() const +{ + auto res = std::make_shared(*this); + cloneOutputOptions(*res); + return res; +} + +void ASTDescribeCacheQuery::formatQueryImpl(const FormatSettings & settings, FormatState &, FormatStateStacked) const +{ + settings.ostr << (settings.hilite ? hilite_keyword : "") << "DESCRIBE FILESYSTEM CACHE" << (settings.hilite ? hilite_none : "") + << " " << quoteString(cache_name); +} + +} diff --git a/src/Parsers/ASTDescribeCacheQuery.h b/src/Parsers/ASTDescribeCacheQuery.h index 3d1cbaef070..55b841e03f6 100644 --- a/src/Parsers/ASTDescribeCacheQuery.h +++ b/src/Parsers/ASTDescribeCacheQuery.h @@ -1,6 +1,8 @@ #pragma once + #include + namespace DB { @@ -9,20 +11,11 @@ class ASTDescribeCacheQuery : public ASTQueryWithOutput public: String cache_name; - String getID(char) const override { return "DescribeCacheQuery"; } - - ASTPtr clone() const override - { - auto res = std::make_shared(*this); - cloneOutputOptions(*res); - return res; - } + String getID(char) const override; + ASTPtr clone() const override; protected: - void formatQueryImpl(const FormatSettings & settings, FormatState &, FormatStateStacked) const override - { - settings.ostr << (settings.hilite ? hilite_keyword : "") << "DESCRIBE FILESYSTEM CACHE" << (settings.hilite ? hilite_none : "") << " " << cache_name; - } + void formatQueryImpl(const FormatSettings & settings, FormatState &, FormatStateStacked) const override; }; }