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

    https://github.com/apache/spark/pull/369#discussion_r13419732
  
    --- Diff: core/src/main/scala/org/apache/spark/rdd/RDD.scala ---
    @@ -423,6 +423,18 @@ abstract class RDD[T: ClassTag](
       def ++(other: RDD[T]): RDD[T] = this.union(other)
     
       /**
    +   * Return this RDD sorted by the given key function.
    +   */
    +  def sortBy[K](
    +      f: (T) ⇒ K,
    +      ascending: Boolean = true,
    +      numPartitions: Int = this.partitions.size)
    +      (implicit ord: Ordering[K], ctag: ClassTag[K]): RDD[T] =
    --- End diff --
    
    If I understand what you are claiming, then I think you are mistaken.  
There is only one implicit parameter list, though, so I don't think you can 
supply an argument for only one of the implicits:
    ```
    scala> def foo[A: ClassTag](implicit ord: Ordering[A]) = 
(implicitly[ClassTag[A]], ord)
    foo: [A](implicit evidence$1: scala.reflect.ClassTag[A], implicit ord: 
scala.math.Ordering[A])(scala.reflect.ClassTag[A], scala.math.Ordering[A])
    
    scala> foo[Int]
    res1: (scala.reflect.ClassTag[Int], scala.math.Ordering[Int]) = 
(Int,scala.math.Ordering$Int$@5e10a811)
    
    scala> foo[Int](scala.reflect.classTag[Int], Ordering[Int])
    res2: (scala.reflect.ClassTag[Int], scala.math.Ordering[Int]) = 
(Int,scala.math.Ordering$Int$@5e10a811)
    
    scala> foo[Int](scala.reflect.classTag[Int], Ordering[Int].reverse)
    res3: (scala.reflect.ClassTag[Int], scala.math.Ordering[Int]) = 
(Int,scala.math.Ordering$$anon$4@7293296)
    ```


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to