This commit is contained in:
Dmitry Novik 2024-01-03 13:54:17 +00:00
parent 76f58fb49e
commit 1c3364046e

View File

@ -77,12 +77,12 @@ public:
{
/// Replace ALIAS column with expression
bool column_already_exists = table_expression_data.hasColumn(column_node->getColumnName());
if (column_already_exists)
return;
if (!column_already_exists)
{
auto column_identifier = planner_context.getGlobalPlannerContext()->createColumnIdentifier(node);
table_expression_data.addAliasColumnName(column_node->getColumnName(), column_identifier);
}
auto column_identifier = planner_context.getGlobalPlannerContext()->createColumnIdentifier(node);
table_expression_data.addAliasColumnName(column_node->getColumnName(), column_identifier);
node = column_node->getExpression();
visitImpl(node);
return;