We are facing certain challenges in sorting of data on dataframes in Spark 1.6 . We are using df. orderBy(userColumn, rankColumn). The sorting of data is proper when the dataframe data is in one partition. As soon as the partition size increases , the dataframe sorting is not working on clustered environment. We tried Distribute by and sort by approach as well as per the below post: http://saurzcode.in/2015/01/hive-sort-vs-order-vs-distribute-vs-cluster/. This is also not working. Please suggest.