2020-12-12 16:42:15 +00:00
|
|
|
#include <Interpreters/replaceAliasColumnsInQuery.h>
|
|
|
|
#include <Interpreters/ColumnAliasesVisitor.h>
|
|
|
|
#include <Storages/ColumnsDescription.h>
|
|
|
|
#include <Parsers/ASTSelectQuery.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2021-07-18 15:27:19 +00:00
|
|
|
bool replaceAliasColumnsInQuery(
|
2021-09-14 11:13:07 +00:00
|
|
|
ASTPtr & ast,
|
|
|
|
const ColumnsDescription & columns,
|
|
|
|
const NameToNameMap & array_join_result_to_source,
|
|
|
|
ContextPtr context,
|
|
|
|
const std::unordered_set<IAST *> & excluded_nodes)
|
2020-12-12 16:42:15 +00:00
|
|
|
{
|
2021-09-14 11:13:07 +00:00
|
|
|
ColumnAliasesVisitor::Data aliases_column_data(columns, array_join_result_to_source, context, excluded_nodes);
|
2021-05-28 16:44:59 +00:00
|
|
|
ColumnAliasesVisitor aliases_column_visitor(aliases_column_data);
|
|
|
|
aliases_column_visitor.visit(ast);
|
2021-07-18 15:27:19 +00:00
|
|
|
return aliases_column_data.changed;
|
2020-12-12 16:42:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|