From bf536a82e795b6182dc95950bdd6ea13c5bde8a3 Mon Sep 17 00:00:00 2001 From: Karol Sobczak Date: Mon, 14 Oct 2024 18:32:02 +0200 Subject: [PATCH] Remove redundant check Grouping keys are always part of output symbols --- .../main/java/io/trino/sql/planner/plan/AggregationNode.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/plan/AggregationNode.java b/core/trino-main/src/main/java/io/trino/sql/planner/plan/AggregationNode.java index a69db78af5ea..a02b94acb4bd 100644 --- a/core/trino-main/src/main/java/io/trino/sql/planner/plan/AggregationNode.java +++ b/core/trino-main/src/main/java/io/trino/sql/planner/plan/AggregationNode.java @@ -31,7 +31,6 @@ import io.trino.sql.planner.Symbol; import io.trino.type.FunctionType; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; @@ -233,8 +232,7 @@ public boolean producesDistinctRows() { return aggregations.isEmpty() && !groupingSets.getGroupingKeys().isEmpty() && - outputs.size() == groupingSets.getGroupingKeys().size() && - new HashSet<>(outputs).containsAll(groupingSets.getGroupingKeys()); + outputs.size() == groupingSets.getGroupingKeys().size(); } public boolean isDecomposable(Session session, Metadata metadata)