sortByKey
Returns a dataset sorted by the first (_1
) value of each Tuple2 inside.
Returns a dataset sorted by the first (first
) value of each Pair inside.
fun <K, V> JavaRDD<Tuple2<K, V>>.sortByKey(ascending: Boolean, numPartitions: Int): JavaRDD<Tuple2<K, V>>
fun <K, V> JavaRDD<Tuple2<K, V>>.sortByKey(comp: Comparator<K>, ascending: Boolean = true): JavaRDD<Tuple2<K, V>>
fun <K, V> JavaRDD<Tuple2<K, V>>.sortByKey(comp: Comparator<K>, ascending: Boolean, numPartitions: Int): JavaRDD<Tuple2<K, V>>
Sort the RDD by key, so that each partition contains a sorted range of the elements. Calling JavaRDD.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).
Deprecated
Use Scala tuples instead.
Replace with
Returns a dataset sorted by the first (_1
) value of each Arity2 inside.