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

    https://github.com/apache/spark/pull/2839#discussion_r19046865
  
    --- Diff: core/src/main/scala/org/apache/spark/rdd/RDD.scala ---
    @@ -911,32 +911,15 @@ abstract class RDD[T: ClassTag](
       }
     
       /**
    -   * Return the count of each unique value in this RDD as a map of (value, 
count) pairs. The final
    -   * combine step happens locally on the master, equivalent to running a 
single reduce task.
    +   * Return the count of each unique value in this RDD as a local map of 
(value, count) pairs.
    +   *
    +   * Note that this method should only be used if the resulting map is 
expected to be small, as
    +   * the whole thing is loaded into the driver's memory.
    +   * To handle very large results, consider using rdd.map(x => (x, 
1)).reduceByKey(_ + _), which
    +   * returns an RDD[T, Long] instead of a map.
        */
       def countByValue()(implicit ord: Ordering[T] = null): Map[T, Long] = {
    -    if (elementClassTag.runtimeClass.isArray) {
    -      throw new SparkException("countByValue() does not support arrays")
    --- End diff --
    
    Note that we still don't support arrays, but this is caught by combineByKey:
    `org.apache.spark.SparkException: Cannot use map-side combining with array 
keys.`


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to