Fixed a problem where `sum`, `size`, `average`, `minimum` and `maximum` used
with a grouping was not returning a Hash.
Merge pull request #14803 from kuldeepaggarwal/null_relation_sum_fix

Fixed a problem where `sum` used with a `group` was not returning a Hash.