Google News
logo
PySpark - Quiz(MCQ)
Which of the following is used to create a PairRDD in PySpark?
A)
zip()
B)
map()
C)
flatMap()
D)
groupByKey()

Correct Answer :   zip()


Explanation : zip() is used to create a PairRDD in PySpark. It creates a new RDD by aggregating the elements of two RDDs into pairs. The first element of each RDD becomes the key, and the second element becomes the value. Other PairRDD operations in PySpark include reduceByKey(), groupByKey(), and join().

Advertisement