SORT BY Clause - Spark 3.3.1 Documentation - Apache Spark
spark.apache.org › docs › latestSpecifies a comma-separated list of expressions along with optional parameters sort_direction and nulls_sort_order which are used to sort the rows within each partition. sort_direction. Optionally specifies whether to sort the rows in ascending or descending order. The valid values for the sort direction are ASC for ascending and DESC for descending. If sort direction is not explicitly specified, then by default rows are sorted ascending.