Revert "Move experimental join transformations to syntax analyzer"

This reverts commit 0e2316e0ac.
This commit is contained in:
Ivan Lezhankin 2019-02-27 16:35:43 +03:00
parent 2a604d075a
commit d66626a35a
2 changed files with 27 additions and 24 deletions

View File

@ -1,20 +1,17 @@
#include <Interpreters/SyntaxAnalyzer.h>
#include <Interpreters/ArrayJoinedColumnsVisitor.h>
#include <Interpreters/Context.h>
#include <Interpreters/CrossToInnerJoinVisitor.h>
#include <Interpreters/ExecuteScalarSubqueriesVisitor.h>
#include <Interpreters/ExternalDictionaries.h>
#include <Interpreters/InJoinSubqueriesPreprocessor.h>
#include <Interpreters/InterpreterSelectWithUnionQuery.h>
#include <Interpreters/JoinToSubqueryTransformVisitor.h>
#include <Interpreters/LogicalExpressionsOptimizer.h>
#include <Interpreters/OptimizeIfWithConstantConditionVisitor.h>
#include <Interpreters/PredicateExpressionsOptimizer.h>
#include <Interpreters/QueryAliasesVisitor.h>
#include <Interpreters/QueryNormalizer.h>
#include <Interpreters/Settings.h>
#include <Interpreters/QueryAliasesVisitor.h>
#include <Interpreters/InterpreterSelectWithUnionQuery.h>
#include <Interpreters/ArrayJoinedColumnsVisitor.h>
#include <Interpreters/TranslateQualifiedNamesVisitor.h>
#include <Interpreters/Context.h>
#include <Interpreters/QueryNormalizer.h>
#include <Interpreters/ExecuteScalarSubqueriesVisitor.h>
#include <Interpreters/PredicateExpressionsOptimizer.h>
#include <Interpreters/ExternalDictionaries.h>
#include <Interpreters/OptimizeIfWithConstantConditionVisitor.h>
#include <Parsers/ASTExpressionList.h>
#include <Parsers/ASTFunction.h>
@ -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())

View File

@ -21,6 +21,8 @@
#include <Parsers/parseQuery.h>
#include <Parsers/queryToString.h>
#include <Interpreters/JoinToSubqueryTransformVisitor.h>
#include <Interpreters/CrossToInnerJoinVisitor.h>
#include <Interpreters/Quota.h>
#include <Interpreters/InterpreterFactory.h>
#include <Interpreters/ProcessList.h>
@ -194,6 +196,22 @@ static std::tuple<ASTPtr, BlockIO> 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);