if (setFunctionType.COUNT() == null && isDistinct) {
throw new RuntimeException("DISTINCT for set function implemented only for COUNT");
}
if (setFunctionType.MIN() != null) {
aggr = new MinAggregated(innerNc);
} else if (setFunctionType.MAX() != null) {
aggr = new MaxAggregated(innerNc);
} else if (setFunctionType.SUM() != null) {
aggr = new SumAggregated(innerNc);
} else if (setFunctionType.AVG() != null) {