mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
remove old nodes from node_to_projection_name when node become nullable
This commit is contained in:
parent
33169e72df
commit
e002e42805
@ -3560,13 +3560,17 @@ QueryTreeNodePtr QueryAnalyzer::tryResolveIdentifierFromJoin(const IdentifierLoo
|
||||
|
||||
if (scope.join_use_nulls)
|
||||
{
|
||||
auto it = node_to_projection_name.find(resolved_identifier);
|
||||
auto projection_name_it = node_to_projection_name.find(resolved_identifier);
|
||||
auto nullable_resolved_identifier = convertJoinedColumnTypeToNullIfNeeded(resolved_identifier, join_kind, resolved_side, scope);
|
||||
if (nullable_resolved_identifier)
|
||||
{
|
||||
resolved_identifier = nullable_resolved_identifier;
|
||||
if (it != node_to_projection_name.end())
|
||||
node_to_projection_name.emplace(resolved_identifier, it->second);
|
||||
/// Set the same projection name for new nullable node
|
||||
if (projection_name_it != node_to_projection_name.end())
|
||||
{
|
||||
node_to_projection_name.erase(projection_name_it);
|
||||
node_to_projection_name.emplace(resolved_identifier, projection_name_it->second);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4686,11 +4690,14 @@ ProjectionNames QueryAnalyzer::resolveMatcher(QueryTreeNodePtr & matcher_node, I
|
||||
node = nullable_node;
|
||||
/// Set the same projection name for new nullable node
|
||||
if (projection_name_it != node_to_projection_name.end())
|
||||
{
|
||||
node_to_projection_name.erase(projection_name_it);
|
||||
node_to_projection_name.emplace(node, projection_name_it->second);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::unordered_map<const IColumnTransformerNode *, std::unordered_set<std::string>> strict_transformer_to_used_column_names;
|
||||
for (const auto & transformer : matcher_node_typed.getColumnTransformers().getNodes())
|
||||
|
Loading…
Reference in New Issue
Block a user