ClickHouse/src/Interpreters/ApplyWithAliasVisitor.h

25 lines
413 B
C++
Raw Normal View History

2020-09-29 16:32:41 +00:00
#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);
};
}