Merge pull request #50584 from ClickHouse/analyzer-optimizations-on-shards

Analyzer: Do not apply Query Tree optimizations on shards
This commit is contained in:
Dmitry Novik 2023-06-14 14:31:46 +02:00 committed by GitHub
commit 1d88b16830
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -135,7 +135,10 @@ QueryTreeNodePtr buildQueryTreeAndRunPasses(const ASTPtr & query,
QueryTreePassManager query_tree_pass_manager(context);
addQueryTreePasses(query_tree_pass_manager);
if (select_query_options.ignore_ast_optimizations)
/// 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*/);
else
query_tree_pass_manager.run(query_tree);

View File

@ -98,7 +98,6 @@
02458_use_structure_from_insertion_table
02479_race_condition_between_insert_and_droppin_mv
02493_inconsistent_hex_and_binary_number
02494_optimize_group_by_function_keys_and_alias_columns
02521_aggregation_by_partitions
02554_fix_grouping_sets_predicate_push_down
02575_merge_prewhere_different_default_kind