GitHub user CrazyJvm opened a pull request:

    https://github.com/apache/spark/pull/403

    misleading task number of groupByKey

    "By default, this uses only 8 parallel tasks to do the grouping." is a big 
misleading. Please refer to https://github.com/apache/spark/pull/389 
    
    detail is as following code :
    <code>
      def defaultPartitioner(rdd: RDD[_], others: RDD[_]*): Partitioner = {
        val bySize = (Seq(rdd) ++ others).sortBy(_.partitions.size).reverse
        for (r <- bySize if r.partitioner.isDefined) {
          return r.partitioner.get
        }
        if (rdd.context.conf.contains("spark.default.parallelism")) {
          new HashPartitioner(rdd.context.defaultParallelism)
        } else {
          new HashPartitioner(bySize.head.partitions.size)
        }
      }
    </code>

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/CrazyJvm/spark patch-4

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/403.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #403
    
----
commit 156833643d9ea1479222e9033164e92a9846351c
Author: Chen Chao <[email protected]>
Date:   2014-04-14T07:39:50Z

    misleading task number of groupByKey
    
    "By default, this uses only 8 parallel tasks to do the grouping." is a big 
misleading. Please refer to https://github.com/apache/spark/pull/389 
    
    detail is as following code :
    <code>
      def defaultPartitioner(rdd: RDD[_], others: RDD[_]*): Partitioner = {
        val bySize = (Seq(rdd) ++ others).sortBy(_.partitions.size).reverse
        for (r <- bySize if r.partitioner.isDefined) {
          return r.partitioner.get
        }
        if (rdd.context.conf.contains("spark.default.parallelism")) {
          new HashPartitioner(rdd.context.defaultParallelism)
        } else {
          new HashPartitioner(bySize.head.partitions.size)
        }
      }
    </code>

----


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