2012-08-22 18:46:09 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <DB/DataTypes/IDataType.h>
|
|
|
|
|
|
|
|
#include <DB/Parsers/IAST.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
|
2014-12-15 20:43:24 +00:00
|
|
|
/** Подзарос SELECT
|
2012-08-22 18:46:09 +00:00
|
|
|
*/
|
|
|
|
class ASTSubquery : public IAST
|
|
|
|
{
|
|
|
|
public:
|
2014-12-15 20:43:24 +00:00
|
|
|
ASTSubquery() = default;
|
2014-12-17 15:26:24 +00:00
|
|
|
ASTSubquery(const StringRange range_) : IAST(range_) {}
|
2012-08-22 18:46:09 +00:00
|
|
|
|
|
|
|
/** Получить текст, который идентифицирует этот элемент. */
|
2014-12-15 20:43:24 +00:00
|
|
|
String getID() const override { return "Subquery"; }
|
|
|
|
|
|
|
|
ASTPtr clone() const override
|
|
|
|
{
|
|
|
|
const auto res = new ASTSubquery{*this};
|
|
|
|
ASTPtr ptr{res};
|
2014-12-17 15:26:24 +00:00
|
|
|
|
2014-12-15 20:43: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
|
|
|
|
2014-12-15 20:43:24 +00:00
|
|
|
return ptr;
|
|
|
|
}
|
2012-08-22 23:09:26 +00:00
|
|
|
|
2014-12-15 20:43:24 +00:00
|
|
|
String getColumnName() const override { return getTreeID(); }
|
2012-08-22 18:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|