1 | #pragma once |
---|---|
2 | |
3 | #include <Parsers/ASTWithAlias.h> |
4 | |
5 | |
6 | namespace DB |
7 | { |
8 | |
9 | |
10 | /** SELECT subquery |
11 | */ |
12 | class ASTSubquery : public ASTWithAlias |
13 | { |
14 | public: |
15 | /** Get the text that identifies this element. */ |
16 | String getID(char) const override { return "Subquery"; } |
17 | |
18 | ASTPtr clone() const override |
19 | { |
20 | const auto res = std::make_shared<ASTSubquery>(*this); |
21 | ASTPtr ptr{res}; |
22 | |
23 | res->children.clear(); |
24 | |
25 | for (const auto & child : children) |
26 | res->children.emplace_back(child->clone()); |
27 | |
28 | return ptr; |
29 | } |
30 | |
31 | protected: |
32 | void formatImplWithoutAlias(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override; |
33 | void appendColumnNameImpl(WriteBuffer & ostr) const override; |
34 | }; |
35 | |
36 | } |
37 |