Fix empty Sum and SumDistinct.
Fix empty Average.
Add tests to be executed as non-partial aggregation.
Use aggregate instead of groupBy().