Sort the RDD by key, so that each partition contains a sorted range of the elements.
Sort the RDD by key, so that each partition contains a sorted range of the elements. Calling
collect
or save
on the resulting RDD will return or output an ordered list of records
(in the save
case, they will be written to multiple part-X
files in the filesystem, in
order of the keys).
Extra functions available on RDDs of (key, value) pairs where the key is sortable through an implicit conversion. Import
spark.SparkContext._
at the top of your program to use these functions. They will work with any key type that has ascala.math.Ordered
implementation.