aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Interpreters/replaceAliasColumnsInQuery.cpp
blob: fc6a97e2039ac3b9d172853c16f00e9f58caf8b0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <Interpreters/replaceAliasColumnsInQuery.h>
#include <Interpreters/ColumnAliasesVisitor.h>
#include <Storages/ColumnsDescription.h>
#include <Parsers/ASTSelectQuery.h>

namespace DB
{

bool replaceAliasColumnsInQuery(
        ASTPtr & ast,
        const ColumnsDescription & columns,
        const NameToNameMap & array_join_result_to_source,
        ContextPtr context,
        const std::unordered_set<IAST *> & excluded_nodes)
{
    ColumnAliasesVisitor::Data aliases_column_data(columns, array_join_result_to_source, context, excluded_nodes);
    ColumnAliasesVisitor aliases_column_visitor(aliases_column_data);
    aliases_column_visitor.visit(ast);
    return aliases_column_data.changed;
}

}