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

Executing sum distinct for empty table throws `java.lang.UnsupportedOperationException: empty.reduceLeft`.
Yes.  There is likely still a similar issue with AVG of empty, which should also return `null` instead of `NaN`.