SPARK-3461. Support external groupByKey using repartitionAndSortWithinPartitions