I understand that only when mutable data types are used in the aggregation function hash aggregation is chosen by spark. But with spark 2.2 object based aggregation was introduced but still i see sort based aggregation being chosen.
- Why is object based aggregation not used instead?
- What is the reason behind using this logic of mutable vs immutable datatype to chose one or the other (i am not able to understand how mutability matters in both algorithms)