mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Merge pull request #61789 from ClickHouse/vdimir/analyzer_join_distributed_assert
Analyzer: Fix assert in JOIN with Distributed table
This commit is contained in:
commit
5e51880750
@ -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;
|
||||
|
@ -960,8 +960,14 @@ JoinTreeQueryPlan buildQueryPlanForTableExpression(QueryTreeNodePtr table_expres
|
||||
}
|
||||
else
|
||||
{
|
||||
std::shared_ptr<GlobalPlannerContext> subquery_planner_context;
|
||||
if (wrap_read_columns_in_subquery)
|
||||
subquery_planner_context = std::make_shared<GlobalPlannerContext>(nullptr, nullptr, FiltersForTableExpressionMap{});
|
||||
else
|
||||
subquery_planner_context = planner_context->getGlobalPlannerContext();
|
||||
|
||||
auto subquery_options = select_query_options.subquery();
|
||||
Planner subquery_planner(table_expression, subquery_options, planner_context->getGlobalPlannerContext());
|
||||
Planner subquery_planner(table_expression, subquery_options, subquery_planner_context);
|
||||
/// Propagate storage limits to subquery
|
||||
subquery_planner.addStorageLimits(*select_query_info.storage_limits);
|
||||
subquery_planner.buildQueryPlanIfNeeded();
|
||||
|
Loading…
Reference in New Issue
Block a user