Help needed pyspark

pyspark
python

#1

inpyspark ,How can create all possible pairs from rdd keys ?
rdd = [(‘FRO21081’, 436), (‘SNA41431’, 144), (‘ELE24630’, 321), (‘ELE56788’, 1345)]

output:
[(FRO21081,SNA41431) , (FRO21081,ELE24630),(FRO21081,ELE56788),(SNA41431,ELE24630),(SNA41431,ELE56788),(ELE24630,ELE56788)]

Note : This is not related to certification


#2

I got solution
items = rdd.keys() // get all keys
combinationPairs = items.cartesian(items)


#3