OrderedRDDFunctions¶
OrderedRDDFunctions adds extra operators to RDDs of (key, value) pairs (RDD[(K, V)]) where the K key is sortable (i.e. any key type K that has an implicit Ordering[K] in scope).
Tip
Learn more about Ordering in the Scala Standard Library documentation.
Creating Instance¶
OrderedRDDFunctions takes the following to be created:
- RDD of
Ps
OrderedRDDFunctions is created using RDD.rddToOrderedRDDFunctions implicit method.
filterByRange¶
filterByRange...FIXME
repartitionAndSortWithinPartitions¶
repartitionAndSortWithinPartitions creates a ShuffledRDD with the given Partitioner.
Note
repartitionAndSortWithinPartitions is a generalization of sortByKey operator.
sortByKey¶
sortByKey creates a ShuffledRDD (with the RDD and a RangePartitioner).
Note
sortByKey is a specialization of repartitionAndSortWithinPartitions operator.
sortByKey is used when:
- RDD.sortBy high-level operator is used