i would like to sort K/V pairs by values and then take the biggest five values. I managed to do this with reverting K/V with first map, sort in descending order with FALSE, and
Sort by keys (ascending):
RDD.takeOrdered(5, key = lambda x: x[0])
Sort by keys (descending):
RDD.takeOrdered(5, key = lambda x: -x[0])
Sort by values (ascending):
RDD.takeOrdered(5, key = lambda x: x[1])
Sort by values (descending):
RDD.takeOrdered(5, key = lambda x: -x[1])