From f44960bb63e28b30dc4d459fb048b13b8ffd936b Mon Sep 17 00:00:00 2001 From: Dmitry Novik Date: Tue, 17 Sep 2024 18:23:43 +0200 Subject: [PATCH] Add logs when disabling analyzer --- src/Interpreters/IInterpreterUnionOrSelectQuery.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Interpreters/IInterpreterUnionOrSelectQuery.cpp b/src/Interpreters/IInterpreterUnionOrSelectQuery.cpp index b7931491704..27716aeca57 100644 --- a/src/Interpreters/IInterpreterUnionOrSelectQuery.cpp +++ b/src/Interpreters/IInterpreterUnionOrSelectQuery.cpp @@ -12,6 +12,7 @@ #include #include #include +#include namespace DB @@ -28,7 +29,13 @@ IInterpreterUnionOrSelectQuery::IInterpreterUnionOrSelectQuery(const ASTPtr & qu /// it's possible that new analyzer will be enabled in ::getQueryProcessingStage method /// of the underlying storage when all other parts of infrastructure are not ready for it /// (built with old analyzer). - // context->setSetting("allow_experimental_analyzer", false); + if (context->getSettingsRef().allow_experimental_analyzer) + { + LOG_TRACE(getLogger("IInterpreterUnionOrSelectQuery"), + "The new analyzer is enabled, but the old interpreter is used. It can be a bug, please report it. Will disable 'allow_experimental_analyzer' setting (for query: {})", + query_ptr->formatForLogging()); + context->setSetting("allow_experimental_analyzer", false); + } if (options.shard_num) context->addSpecialScalar(