sortByColumns
Sorts a dataframe-like object by multiple columns. If a column type is not comparable, sorting by string representation is applied instead. Sorts DataFrames by their size because looking at the smallest / biggest groups after groupBy is very popular.
Returns a "lazily materialized" dataframe, which means a get, getRows, or take operation must be applied to turn it into a valid sorted dataframe. "lazily materialized" - after sorting 1 million rows and given the page size = 100, a dataframe with only 100 rows is created.
Return
The sorted dataframe.
Parameters
The dataframe-like object to sort.
The list of columns to sort by. Each element in the list represents a column path.
The list of booleans indicating whether each column should be sorted in descending order. The size of this list should be the same as the size of the columnPaths list.
Throws
if dataFrameLike is null.
Sorts a dataframe by multiple columns with specified sorting order for each column. If a column type is not comparable, sorting by string representation is applied instead.
Return
The sorted dataframe.
Parameters
The dataframe to be sorted.
A list of column paths where each path is a list of strings representing the hierarchical path of the column.
A list of boolean values indicating whether each column should be sorted in descending order; true for descending, false for ascending. The size of this list should match the size of columnPaths.