diff --git a/src/Planner/PlannerExpressionAnalysis.cpp b/src/Planner/PlannerExpressionAnalysis.cpp index d7fa270a643..ad8db83d66c 100644 --- a/src/Planner/PlannerExpressionAnalysis.cpp +++ b/src/Planner/PlannerExpressionAnalysis.cpp @@ -85,8 +85,6 @@ std::optional analyzeAggregation(const QueryTreeNodeP bool group_by_use_nulls = planner_context->getQueryContext()->getSettingsRef().group_by_use_nulls && (query_node.isGroupByWithGroupingSets() || query_node.isGroupByWithRollup() || query_node.isGroupByWithCube()); - bool is_secondary_query = planner_context->getQueryContext()->getClientInfo().query_kind == ClientInfo::QueryKind::SECONDARY_QUERY; - if (query_node.hasGroupBy()) { if (query_node.isGroupByWithGroupingSets()) @@ -102,7 +100,7 @@ std::optional analyzeAggregation(const QueryTreeNodeP auto is_constant_key = grouping_set_key_node->as() != nullptr; group_by_with_constant_keys |= is_constant_key; - if (!is_secondary_query && is_constant_key && !aggregates_descriptions.empty()) + if (is_constant_key && !aggregates_descriptions.empty()) continue; auto expression_dag_nodes = actions_visitor.visit(before_aggregation_actions, grouping_set_key_node); @@ -154,7 +152,7 @@ std::optional analyzeAggregation(const QueryTreeNodeP auto is_constant_key = group_by_key_node->as() != nullptr; group_by_with_constant_keys |= is_constant_key; - if (!is_secondary_query && is_constant_key && !aggregates_descriptions.empty()) + if (is_constant_key && !aggregates_descriptions.empty()) continue; auto expression_dag_nodes = actions_visitor.visit(before_aggregation_actions, group_by_key_node); diff --git a/tests/queries/0_stateless/03095_group_by_server_constants_bug.reference b/tests/queries/0_stateless/03095_group_by_server_constants_bug.reference deleted file mode 100644 index 80ab3c879bb..00000000000 --- a/tests/queries/0_stateless/03095_group_by_server_constants_bug.reference +++ /dev/null @@ -1 +0,0 @@ -r1 2 diff --git a/tests/queries/0_stateless/03095_group_by_server_constants_bug.sql b/tests/queries/0_stateless/03095_group_by_server_constants_bug.sql deleted file mode 100644 index 9f9fda1ef62..00000000000 --- a/tests/queries/0_stateless/03095_group_by_server_constants_bug.sql +++ /dev/null @@ -1,5 +0,0 @@ -SELECT serverUUID() AS s, count() FROM remote('127.0.0.{1,2}', system.one) GROUP BY s format Null; - -select getMacro('replica') as s, count() from remote('127.0.0.{1,2}', system.one) group by s; - -select uptime() as s, count() FROM remote('127.0.0.{1,2}', system.one) group by s format Null;