From 8383e9d52ede421fe55f4d0193e2aeb14c6de9cf Mon Sep 17 00:00:00 2001 From: lukasz-stec Date: Tue, 19 Sep 2023 20:35:40 +0200 Subject: [PATCH] Make the order of complex grouping key consistent --- .../src/main/java/io/trino/sql/planner/QueryPlanner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/QueryPlanner.java b/core/trino-main/src/main/java/io/trino/sql/planner/QueryPlanner.java index 4bb85fc6b46f4..c2960e5cc6301 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/QueryPlanner.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/QueryPlanner.java @@ -1156,7 +1156,7 @@ private GroupingSetsPlan planGroupingSets(PlanBuilder subPlan, QuerySpecificatio groupingSetMappings.put(output, input); } - Map, Symbol> complexExpressions = new HashMap<>(); + Map, Symbol> complexExpressions = new LinkedHashMap<>(); for (Expression expression : groupingSetAnalysis.getComplexExpressions()) { if (!complexExpressions.containsKey(scopeAwareKey(expression, analysis, subPlan.getScope()))) { Symbol input = subPlan.translate(expression);