spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SK <skrishna...@gmail.com>
Subject specifying sort order for sort by value
Date Thu, 06 Nov 2014 18:50:04 GMT
Hi,

I am using rdd.sortBy(_._2) to get an RDD sorted by value. The default order
is ascending order. How can I get it sorted  in descending order? I could
not find an option to specify the order. 

I need to get the top K elements of the list sorted in descending order. If
there is no option to get the descending order, I would like to know if
there is a way to get the last K elements of the list sorted in ascending
order.  take(k) gets the first k elements, is there an option to get the
last K elements of an RDD ?

thanks



--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/specifying-sort-order-for-sort-by-value-tp18289.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org


Mime
View raw message