Google News
logo
PySpark - Quiz(MCQ)
Which of the following is used to sort data in PySpark?
A)
sort()
B)
groupByKey()
C)
reduceByKey()
D)
sortByKey()

Correct Answer :   sortByKey()


Explanation : sortByKey() is used to sort data in PySpark. It sorts an RDD of (key, value) pairs by the key in ascending or descending order. Other sorting operations in PySpark include sort(), sortBy(), and sortByValue().

Advertisement