Reputation: 5640
If I have an RDD that has key-value pair and I want to get only the key part, what is the most efficient way of doing it?
Upvotes: 8
Views: 17959
Reputation: 2749
It is very simple yourRDD.keys()
yourRDD.keys()
Similarly you can get RDD with values by youRDD.values()
youRDD.values()
For this and other RDD transformations and actions see examples here
Upvotes: 19