[SPARK-4318][SQL] Fix empty sum distinct.

Executing sum distinct for empty table throws `java.lang.UnsupportedOperationException: empty.reduceLeft`.
Are you changing the semantics of the aggregation here?  We are trying to follow specific rules about how precision is supposed to change when doing aggregation of decimals.  [See here for more details](https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/HiveTypeCoercion.scala#L284)