From d66626a35ad31fde832e25d3640ee24464384b85 Mon Sep 17 00:00:00 2001 From: Ivan Lezhankin Date: Wed, 27 Feb 2019 16:35:43 +0300 Subject: [PATCH] Revert "Move experimental join transformations to syntax analyzer" This reverts commit 0e2316e0ac422e999b5f3777d457de8c4b0e283b. --- dbms/src/Interpreters/SyntaxAnalyzer.cpp | 33 +++++++----------------- dbms/src/Interpreters/executeQuery.cpp | 18 +++++++++++++ 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/dbms/src/Interpreters/SyntaxAnalyzer.cpp b/dbms/src/Interpreters/SyntaxAnalyzer.cpp index dee58b89c89..d3b42c57926 100644 --- a/dbms/src/Interpreters/SyntaxAnalyzer.cpp +++ b/dbms/src/Interpreters/SyntaxAnalyzer.cpp @@ -1,20 +1,17 @@ #include - -#include -#include -#include -#include -#include #include -#include -#include #include -#include -#include -#include -#include #include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include #include #include @@ -651,18 +648,6 @@ SyntaxAnalyzerResultPtr SyntaxAnalyzer::analyze( if (source_columns_set.size() != source_columns_list.size()) throw Exception("Unexpected duplicates in source columns list.", ErrorCodes::LOGICAL_ERROR); - if (settings.allow_experimental_multiple_joins_emulation) - { - JoinToSubqueryTransformVisitor::Data join_to_subs_data; - JoinToSubqueryTransformVisitor(join_to_subs_data).visit(query); - } - - if (settings.allow_experimental_cross_to_join_conversion) - { - CrossToInnerJoinVisitor::Data cross_to_inner; - CrossToInnerJoinVisitor(cross_to_inner).visit(query); - } - if (select_query) { if (const ASTTablesInSelectQueryElement * node = select_query->join()) diff --git a/dbms/src/Interpreters/executeQuery.cpp b/dbms/src/Interpreters/executeQuery.cpp index d8b4ff4ebe0..a5856fb6173 100644 --- a/dbms/src/Interpreters/executeQuery.cpp +++ b/dbms/src/Interpreters/executeQuery.cpp @@ -21,6 +21,8 @@ #include #include +#include +#include #include #include #include @@ -194,6 +196,22 @@ static std::tuple executeQueryImpl( if (!internal) logQuery(query.substr(0, settings.log_queries_cut_to_length), context); + if (!internal && settings.allow_experimental_multiple_joins_emulation) + { + JoinToSubqueryTransformVisitor::Data join_to_subs_data; + JoinToSubqueryTransformVisitor(join_to_subs_data).visit(ast); + if (join_to_subs_data.done) + logQuery(queryToString(*ast), context); + } + + if (!internal && settings.allow_experimental_cross_to_join_conversion) + { + CrossToInnerJoinVisitor::Data cross_to_inner; + CrossToInnerJoinVisitor(cross_to_inner).visit(ast); + if (cross_to_inner.done) + logQuery(queryToString(*ast), context); + } + /// Check the limits. checkASTSizeLimits(*ast, settings);