code: private RelBuilder convertMonopole(RelBuilder relBuilder, Aggregate aggregate,
  			List<Integer> argList, int filterArg) {
  		// For example,
  		//    SELECT deptno, COUNT(DISTINCT sal), SUM(DISTINCT sal)
  		//    FROM emp
  		//    GROUP BY deptno
  		//
  		// becomes
  		//
  		//    SELECT deptno, COUNT(distinct_sal), SUM(distinct_sal)
  		//    FROM (
  		//      SELECT DISTINCT deptno, sal AS distinct_sal
  		//      FROM EMP GROUP BY deptno)
  		//    GROUP BY deptno
  
  		// Project the columns of the GROUP BY plus the arguments
  		// to the agg function.
  		final Map<Integer, Integer> sourceOf = new HashMap<>();
  		createSelectDistinct(relBuilder, aggregate, argList, filterArg, sourceOf);
  
  		// Create an aggregate on top, with the new aggregate list.
  		final List<AggregateCall> newAggCalls =
  				com.google.common.collect.Lists.newArrayList(aggregate.getAggCallList());
  		rewriteAggCalls(newAggCalls, argList, sourceOf);
  		final int cardinality = aggregate.getGroupSet().cardinality();
  		relBuilder.push(
  				aggregate.copy(aggregate.getTraitSet(), relBuilder.build(),
  						aggregate.indicator, ImmutableBitSet.range(cardinality), null,
  						newAggCalls));
  		return relBuilder;
  	}
docs: Converts an aggregate relational expression that contains just one
  distinct aggregate function (or perhaps several over the same arguments)
  and no non-distinct aggregate functions.