use aliases if exist for original_select_set

This commit is contained in:
Yakov Olkhovskiy 2022-04-03 22:10:36 -04:00
parent ec0ad8804a
commit 95ad1bf6e1

View File

@ -286,8 +286,10 @@ InterpreterSelectQuery::InterpreterSelectQuery(
{
checkStackSize();
for (const auto & column : query_ptr->as<ASTSelectQuery &>().select()->children)
original_select_set.insert(column->getColumnName());
for (const auto & column : query_ptr->as<ASTSelectQuery &>().select()->children) {
std::string alias = column->tryGetAlias();
original_select_set.insert(alias.empty() ? column->getColumnName() : alias);
}
query_info.ignore_projections = options.ignore_projections;
query_info.is_projection_query = options.is_projection_query;