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

    https://github.com/apache/spark/pull/21859#discussion_r208770924
  
    --- Diff: core/src/main/scala/org/apache/spark/Partitioner.scala ---
    @@ -166,7 +169,16 @@ class RangePartitioner[K : Ordering : ClassTag, V](
           // Assume the input partitions are roughly balanced and over-sample 
a little bit.
           val sampleSizePerPartition = math.ceil(3.0 * sampleSize / 
rdd.partitions.length).toInt
           val (numItems, sketched) = RangePartitioner.sketch(rdd.map(_._1), 
sampleSizePerPartition)
    -      if (numItems == 0L) {
    +      val numSampled = sketched.map(_._3.length).sum
    +      if (numItems == 0) {
    +        Array.empty
    +      }
    +      // already got the whole data
    +      else if (sampleCacheEnabled && numItems == numSampled) {
    --- End diff --
    
    This is style issue.
    
    ```scala
    if (numItems == 0) {
    } else if {
      ...
    }
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to