Skip to content

Commit 7d3738c

Browse files
Backport ClickHouse#88544 to 25.8: Fix ColumnBLOB should be converted to a regular column before usage from CREATE AS SELECT
1 parent 1d5db7a commit 7d3738c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Planner/Planner.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,15 +1977,18 @@ void Planner::buildPlanForQueryNode()
19771977
addAdditionalFilterStepIfNeeded(query_plan, query_node, select_query_options, planner_context);
19781978
}
19791979

1980+
const auto & client_info = query_context->getClientInfo();
1981+
19801982
// Not all cases are supported here yet. E.g. for this query:
19811983
// select * from remote('127.0.0.{1,2}', numbers_mt(1e6)) group by number
19821984
// we will have `BlocksMarshallingStep` added to the query plan, but not for
19831985
// select * from remote('127.0.0.{1,2}', numbers_mt(1e6))
19841986
// because `to_stage` for it will be `QueryProcessingStage::Complete`.
19851987
if (query_context->getSettingsRef()[Setting::enable_parallel_blocks_marshalling]
1986-
&& query_context->getClientInfo().query_kind == ClientInfo::QueryKind::SECONDARY_QUERY
1988+
&& client_info.query_kind == ClientInfo::QueryKind::SECONDARY_QUERY
19871989
&& select_query_options.to_stage != QueryProcessingStage::Complete // Don't do it for INSERT SELECT, for example
1988-
&& query_context->getClientInfo().distributed_depth <= 1 // Makes sense for higher depths too, just not supported
1990+
&& client_info.distributed_depth <= 1 // Makes sense for higher depths too, just not supported
1991+
&& !client_info.is_replicated_database_internal
19891992
)
19901993
query_plan.addStep(std::make_unique<BlocksMarshallingStep>(query_plan.getCurrentHeader()));
19911994

0 commit comments

Comments
 (0)