ClickHouse/dbms/src/Parsers/ASTSubquery.h

37 lines
754 B
C++
Raw Normal View History

2012-08-22 18:46:09 +00:00
#pragma once
#include <Parsers/ASTWithAlias.h>
2012-08-22 18:46:09 +00:00
namespace DB
{
2017-05-27 17:27:16 +00:00
/** SELECT subquery
2012-08-22 18:46:09 +00:00
*/
class ASTSubquery : public ASTWithAlias
2012-08-22 18:46:09 +00:00
{
public:
2017-05-27 17:27:16 +00:00
/** Get the text that identifies this element. */
String getID() const override { return "Subquery"; }
ASTPtr clone() const override
{
const auto res = std::make_shared<ASTSubquery>(*this);
ASTPtr ptr{res};
2014-12-17 15:26:24 +00:00
res->children.clear();
for (const auto & child : children)
res->children.emplace_back(child->clone());
2012-08-22 18:46:09 +00:00
return ptr;
}
2012-08-22 23:09:26 +00:00
protected:
void formatImplWithoutAlias(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override;
void appendColumnNameImpl(WriteBuffer & ostr) const override;
2012-08-22 18:46:09 +00:00
};
}