sortBy
Returns DataFrame with rows sorted by one or several columns.
API reference: sortBy
By default, columns are sorted in ascending order with null values going first. Available modifiers:
.desc— changes column sort order from ascending to descending.nullsLast— forcesnullvalues to be placed at the end of the order
Related operations: Reorder rows
See column selectors for how to select the columns for this operation.
sortByDesc
Returns DataFrame sorted by one or several columns in descending order.
See column selectors for how to select the columns for this operation.
Sorting within groups
On a GroupBy, sortBy and sortByDesc sort rows only within each group.
If a referenced column cannot be found in a group, both functions throw an exception.
To sort the groups themselves by their keys, use sortByKey() or sortByKeyDesc() instead. See GroupBy transformations for other operations that reorder groups.
sortWith
Returns DataFrame sorted with comparator.
If called on a DataColumn, sortWith() returns the sorted version of the current column based on the given comparator.