Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 2
    I did not know about this method. It is a better solution than sort() . So this is a better answer to the question than mine (though it does maybe provide some useful background ). I am upvoting. Commented Mar 20, 2015 at 18:05
  • Hi, I have a pairRdd, is there a way to use top method in this pairRdd? For example, top(10) will return 10 elements for each key in this 'pairRdd'. I really need to know this. Commented Apr 9, 2015 at 13:52
  • 2
    No, it does not work like that. I suggest a separate question for finding the top 10 by key, as it's a bigger topic. Commented Apr 9, 2015 at 16:17
  • spark.apache.org/docs/latest/api/scala/… Commented Nov 29, 2015 at 12:31