Planner JOIN planning fix

This commit is contained in:
Maksim Kita 2023-02-05 13:21:00 +01:00
parent a090a8449d
commit afb3eb3c31

View File

@ -680,7 +680,8 @@ JoinTreeQueryPlan buildQueryPlanForJoinNode(const QueryTreeNodePtr & join_table_
for (auto & column_from_joined_table : columns_from_joined_table)
{
if (planner_context->getGlobalPlannerContext()->hasColumnIdentifier(column_from_joined_table.name))
if (planner_context->getGlobalPlannerContext()->hasColumnIdentifier(column_from_joined_table.name) &&
outer_scope_columns.contains(column_from_joined_table.name))
table_join->addJoinedColumn(column_from_joined_table);
}