sortByKey
Sorts the key-group pairs of this GroupBy by the keys ascending.
Returns a new GroupBy containing the same keys and groups in the resulting order. The contents of the groups remain unchanged.
Don't confuse this with sortBy that sorts rows within groups.
See also
sortByKeyDescthat sorts the key-group pairs of thisGroupByby the key values descending.sortByCountandsortByCountAscthat sort the key-group pairs of thisGroupByby the group sizes.sortByGroupandsortByGroupDescthat sorts the key-group pairs of thisGroupBybased on computed values.
Check out .GroupBy grammar
For more information: See "GroupBy Transformation" on the documentation website.
Return
A new GroupBy with its key-group pairs sorted by the keys.
Parameters
Whether null values are considered as the largest values when sorting. Default is false.