Add a comment

This commit is contained in:
Dmitry Novik 2023-06-12 13:51:46 +00:00
parent a92ce7f696
commit 26c9bda144

View File

@ -135,6 +135,8 @@ QueryTreeNodePtr buildQueryTreeAndRunPasses(const ASTPtr & query,
QueryTreePassManager query_tree_pass_manager(context);
addQueryTreePasses(query_tree_pass_manager);
/// We should not apply any query tree level optimizations on shards
/// because it can lead to a changed header.
if (select_query_options.ignore_ast_optimizations
|| context->getClientInfo().query_kind == ClientInfo::QueryKind::SECONDARY_QUERY)
query_tree_pass_manager.run(query_tree, 1 /*up_to_pass_index*/);