Add support for DISTINCT/REDUCED.