public UnsafeRow outputForEmptyGroupingKeyWithoutInput() {
        if (groupingExpressions.isEmpty()) {
            // We create a output row and copy it. So, we can free the map.
            UnsafeRow resultCopy = generateOutput.apply(UnsafeRow.createFromByteArray(0, 0), initialAggregationBuffer).copy();
            hashMap.free();
            return resultCopy;
        } else {
            throw new IllegalStateException("This method should not be called when groupingExpressions is not empty.");
        }
    }
Generate a output row when there is no input and there is no grouping expression.
indexr-query-opt/src/main/java/org/apache/spark/sql/execution/aggregate/TungstenAggregationIterator.java