Spark教程
1、逆序
scala> var rdd1=sc.makeRDD(Seq(8,3,6,2,5)) rdd1: org.apache.spark.rdd.RDD[Int] = ParallelCollectionRDD[3] at makeRDD at <console>:26 scala> implicit val myOrder=implicitly[Ordering[Int]].reverse myOrder: scala.math.Ordering[Int] = scala.math.Ordering$$anon$4@7b64279b scala> rdd1.top(3) res2: Array[Int] = Array(2, 3, 5)