presto-main/src/main/java/io/prestosql/operator/StreamingAggregationOperator.java/StreamingAggregationOperator/finish
class StreamingAggregationOperator:    @Override
    public void finish()
    {
        finishing = true;

        if (currentGroup != null) {
            evaluateAndFlushGroup(currentGroup, 0);
            currentGroup = null;
        }

        if (!pageBuilder.isEmpty()) {
            outputPages.add(pageBuilder.build());
            pageBuilder.reset();
        }
    }