The groupBy() function is used during aggregation while your requirement just requires orderBy()
Assuming dataframe df with 3 columns Col1, Col2, Col3, you can do the below in Spark
val sortedDf = df.orderBy(col("Col1").desc,col("Col2").desc,col("Col3").asc)
POC for the same is available here SQLFIDDLE
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.