aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Interpreters/ApplyWithAliasVisitor.h
blob: 8ebe8a6618251b75df6e127e568785d58a3691ba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#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);
};

}