From 85e5ed79e5b60f00df2cf7d8c41b249485c02547 Mon Sep 17 00:00:00 2001 From: Dmitry Novik Date: Thu, 25 May 2023 15:58:08 +0000 Subject: [PATCH] Fix distributed JOINs --- src/Storages/StorageDistributed.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/Storages/StorageDistributed.cpp b/src/Storages/StorageDistributed.cpp index 05f9821f6cb..98c92541f67 100644 --- a/src/Storages/StorageDistributed.cpp +++ b/src/Storages/StorageDistributed.cpp @@ -1006,16 +1006,7 @@ QueryTreeNodePtr buildQueryTreeDistributed(SelectQueryInfo & query_info, global_in_or_join_node.subquery_depth); temporary_table_expression_node->setAlias(join_right_table_expression->getAlias()); - auto in_second_argument_query_node = std::make_shared(Context::createCopy(query_context)); - in_second_argument_query_node->setIsSubquery(true); - in_second_argument_query_node->getProjectionNode() = std::make_shared(); - in_second_argument_query_node->getProjection().getNodes() = { std::make_shared() }; - in_second_argument_query_node->getJoinTree() = std::move(temporary_table_expression_node); - - QueryAnalysisPass query_analysis_pass; - query_analysis_pass.run(in_second_argument_query_node, query_context); - - replacement_map.emplace(join_right_table_expression.get(), std::move(in_second_argument_query_node)); + replacement_map.emplace(join_right_table_expression.get(), std::move(temporary_table_expression_node)); continue; } else if (auto * in_function_node = global_in_or_join_node.query_node->as())