diff --git a/core/trino-main/src/main/java/io/trino/operator/GroupByHash.java b/core/trino-main/src/main/java/io/trino/operator/GroupByHash.java index 5ca6fdcfcb93..d0a477a12062 100644 --- a/core/trino-main/src/main/java/io/trino/operator/GroupByHash.java +++ b/core/trino-main/src/main/java/io/trino/operator/GroupByHash.java @@ -72,6 +72,13 @@ static GroupByHash createGroupByHash( Work addPage(Page page); + /** + * The order of new group ids need to be the same as the order of incoming rows, + * i.e. new group ids should be assigned in rows iteration order + * Example: + * rows: A B C B D A E + * group ids: 1 2 3 2 4 1 5 + */ Work getGroupIds(Page page); boolean contains(int position, Page page, int[] hashChannels);