From f748427ffd4ce11c9e0d225286b87a8a02e45371 Mon Sep 17 00:00:00 2001 From: chertus Date: Wed, 19 Feb 2020 14:20:35 +0300 Subject: [PATCH] minor fix (remove logic dependent on partial_merge_join setting) --- dbms/src/Interpreters/InterpreterSelectQuery.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dbms/src/Interpreters/InterpreterSelectQuery.cpp b/dbms/src/Interpreters/InterpreterSelectQuery.cpp index c100ef1e0fa..10ac3441d6c 100644 --- a/dbms/src/Interpreters/InterpreterSelectQuery.cpp +++ b/dbms/src/Interpreters/InterpreterSelectQuery.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -862,6 +863,7 @@ void InterpreterSelectQuery::executeImpl(TPipeline & pipeline, const BlockInputS if (expressions.hasJoin()) { Block header_before_join; + JoinPtr join = expressions.before_join->getTableJoinAlgo(); if constexpr (pipeline_with_processors) { @@ -879,10 +881,11 @@ void InterpreterSelectQuery::executeImpl(TPipeline & pipeline, const BlockInputS { bool on_totals = type == QueryPipeline::StreamType::Totals; std::shared_ptr ret; - if (settings.partial_merge_join) - ret = std::make_shared(header, expressions.before_join, on_totals, default_totals); - else + if (!join || typeid_cast(join.get())) ret = std::make_shared(header, expressions.before_join, on_totals, default_totals); + else + ret = std::make_shared(header, expressions.before_join, on_totals, default_totals); + return ret; }); } @@ -894,7 +897,7 @@ void InterpreterSelectQuery::executeImpl(TPipeline & pipeline, const BlockInputS stream = std::make_shared(stream, expressions.before_join); } - if (JoinPtr join = expressions.before_join->getTableJoinAlgo()) + if (join) { Block join_result_sample = ExpressionBlockInputStream( std::make_shared(header_before_join), expressions.before_join).getHeader();