presto-main/src/main/java/io/prestosql/GroupByHashPageIndexer.java/GroupByHashPageIndexer/indexPage
class GroupByHashPageIndexer:    @Override
    public int[] indexPage(Page page)
    {
        Work<GroupByIdBlock> work = hash.getGroupIds(page);
        boolean done = work.process();
        // TODO: this class does not yield wrt memory limit; enable it
        verify(done);
        GroupByIdBlock groupIds = work.getResult();
        int[] indexes = new int[page.getPositionCount()];
        for (int i = 0; i < indexes.length; i++) {
            indexes[i] = toIntExact(groupIds.getGroupId(i));
        }
        return indexes;
    }