SPARK-3655 GroupByKeyAndSortValues

See https://issues.apache.org/jira/browse/SPARK-3655

This pullreq is based on the approach that uses repartitionAndSortWithinPartition, but only implements GroupByKeyAndSortValues and not foldLeft.