ClickHouse/src/Parsers/ASTSubquery.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
967 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:
2021-01-13 14:28:36 +00:00
// Stored the name when the subquery is defined in WITH clause. For example:
// WITH (SELECT 1) AS a SELECT * FROM a AS b; cte_name will be `a`.
std::string cte_name;
2021-01-02 04:51:13 +00:00
2017-05-27 17:27:16 +00:00
/** Get the text that identifies this element. */
String getID(char) const override { return "Subquery"; }
ASTPtr clone() const override
{
auto clone = std::make_shared<ASTSubquery>(*this);
clone->cloneChildren();
return clone;
}
2012-08-22 23:09:26 +00:00
2021-01-02 04:51:13 +00:00
void updateTreeHashImpl(SipHash & hash_state) const override;
String getAliasOrColumnName() const override;
String tryGetAlias() const override;
2021-01-02 04:51:13 +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
};
}