[WIP][SPARK-2554][SQL] CountDistinct and SumDistinct should do partial aggregation

It is not valid to call `makeCopy` on objects like `Rand` since they are singletons.  `case class`es without any constructor parameters are also not allowed.