presto-main/src/main/java/io/prestosql/operator/MarkDistinctHash.java/MarkDistinctHash/markDistinctRows
class MarkDistinctHash:    public Work<Block> markDistinctRows(Page page)
    {
        return new TransformWork<>(
                groupByHash.getGroupIds(page),
                ids -> {
                    BlockBuilder blockBuilder = BOOLEAN.createBlockBuilder(null, ids.getPositionCount());
                    for (int i = 0; i < ids.getPositionCount(); i++) {
                        if (ids.getGroupId(i) == nextDistinctId) {
                            BOOLEAN.writeBoolean(blockBuilder, true);
                            nextDistinctId++;
                        }
                        else {
                            BOOLEAN.writeBoolean(blockBuilder, false);
                        }
                    }
                    return blockBuilder.build();
                });
    }