When a dataframe is sorted it is partitioned with a RangePartitioner.
If later we aggregate by the exact same fields over which sort was applied there is a new (apparently useless) Exchange repartitioning by a HashPartitioner.
In my use case the groupBy exchange is still very costly as the aggregate function won't reduce the data volume.
Is there any reason why groupBy always shuffles data, or could this be improved?
Is there currently a way to workaround for the moment, without going to mapPartitions?
Outputs the following