ClickHouse/src/Interpreters/ApplyWithSubqueryVisitor.h

35 lines
834 B
C++
Raw Normal View History

2020-09-12 17:00:04 +00:00
#pragma once
#include <map>
#include <Parsers/IAST.h>
namespace DB
{
class ASTFunction;
2021-04-05 06:36:33 +00:00
class ASTSelectQuery;
class ASTSelectWithUnionQuery;
2020-09-12 17:00:04 +00:00
struct ASTTableExpression;
class ApplyWithSubqueryVisitor
{
public:
struct Data
{
std::map<String, ASTPtr> subqueries;
};
static void visit(ASTPtr & ast) { visit(ast, {}); }
2021-04-05 06:36:33 +00:00
static void visit(ASTSelectQuery & select) { visit(select, {}); }
static void visit(ASTSelectWithUnionQuery & select) { visit(select, {}); }
2020-09-12 17:00:04 +00:00
private:
static void visit(ASTPtr & ast, const Data & data);
2021-04-05 06:36:33 +00:00
static void visit(ASTSelectQuery & ast, const Data & data);
static void visit(ASTSelectWithUnionQuery & ast, const Data & data);
2020-09-12 17:00:04 +00:00
static void visit(ASTTableExpression & table, const Data & data);
static void visit(ASTFunction & func, const Data & data);
};
}