Analyzer: Fix assert in JOIN with Distributed table

This commit is contained in:
vdimir 2024-03-22 17:30:50 +00:00
parent 80e195a41a
commit edc9e8fbc8
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862
2 changed files with 5 additions and 1 deletions

View File

@ -32,6 +32,9 @@ const ColumnIdentifier & GlobalPlannerContext::createColumnIdentifier(const Name
column_identifier = column.name;
auto [it, inserted] = column_identifiers.emplace(column_identifier);
if (!inserted)
throw Exception(ErrorCodes::LOGICAL_ERROR, "Column identifier {} is already registered", column_identifier);
assert(inserted);
return *it;

View File

@ -960,7 +960,8 @@ JoinTreeQueryPlan buildQueryPlanForTableExpression(QueryTreeNodePtr table_expres
else
{
auto subquery_options = select_query_options.subquery();
Planner subquery_planner(table_expression, subquery_options, planner_context->getGlobalPlannerContext());
Planner subquery_planner(table_expression, subquery_options,
std::make_shared<GlobalPlannerContext>(nullptr, nullptr, FiltersForTableExpressionMap{}));
/// Propagate storage limits to subquery
subquery_planner.addStorageLimits(*select_query_info.storage_limits);
subquery_planner.buildQueryPlanIfNeeded();