Thank you!  I'm not incredibly familiar with Java/Scala interactions so
would appreciate the assistance.  Also, didn't know Scala had an Ordering.

Using Guava for the default comparator was based on the
`sortByKey(Boolean)` method in `JavaPairRDD.scala`


On Tue, May 13, 2014 at 10:35 PM, Reynold Xin <notifications@github.com>wrote:

> In core/src/main/scala/org/apache/spark/api/java/JavaRDD.scala:
>
> > @@ -150,6 +153,18 @@ class JavaRDD[T](val rdd: RDD[T])(implicit val classTag: ClassTag[T])
> >      rdd.setName(name)
> >      this
> >    }
> > +
> > +  /**
> > +   * Return this RDD sorted by the given key function.
> > +   */
> > +  def sortBy[S](f: JFunction[T, S], ascending: Boolean, numPartitions: Int): JavaRDD[T] = {
> > +    import scala.collection.JavaConverters._
> > +    def fn = (x: T) => f.call(x)
> > +    implicit val ordering = com.google.common.collect.Ordering.natural().asInstanceOf[Ordering[S]]
>
> I will submit a pr to fix these.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/apache/spark/pull/369/files#r12621500>
> .
>