Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/369#discussion_r12621760
  
    --- Diff: 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]]
    --- End diff --
    
    Actually I gotta focus on something else and considering this is might be 
too last minute for 1.0 given it introduces new APIs, we have more time to push 
it into 1.1.  Do you mind fixing this yourself? The problem is you should've 
cast the type to Comparator[S] instead of Ordering[S] (which is Scala's 
ordering in this scope).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to