ReplaceDistinctWithAggregate replaces DISTINCT ... with GROUP BY ...
ReplaceDistinctWithAggregate
DISTINCT ...
GROUP BY ...