ClickHouse/src/Interpreters/ApplyWithAliasVisitor.h
2020-10-08 15:03:34 +08:00

25 lines
413 B
C++

#pragma once
#include <map>
#include <Parsers/IAST.h>
namespace DB
{
/// Propagate every WITH alias expression to its descendent subqueries, with correct scoping visibility.
class ApplyWithAliasVisitor
{
public:
struct Data
{
std::map<String, ASTPtr> exprs;
};
static void visit(ASTPtr & ast) { visit(ast, {}); }
private:
static void visit(ASTPtr & ast, const Data & data);
};
}