spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JoshRosen <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-3074] [PySpark] support groupByKey() wi...
Date Wed, 17 Sep 2014 17:18:31 GMT
Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1977#discussion_r17678700
  
    --- Diff: python/pyspark/rdd.py ---
    @@ -1562,21 +1560,34 @@ def createZero():
     
             return self.combineByKey(lambda v: func(createZero(), v), func, func, numPartitions)
     
    +    def _can_spill(self):
    +        return self.ctx._conf.get("spark.shuffle.spill", "True").lower() == "true"
    +
    +    def _memory_limit(self):
    +        return _parse_memory(self.ctx._conf.get("spark.python.worker.memory", "512m"))
    +
         # TODO: support variant with custom partitioner
         def groupByKey(self, numPartitions=None):
             """
             Group the values for each key in the RDD into a single sequence.
    -        Hash-partitions the resulting RDD with into numPartitions partitions.
    +        Hash-partitions the resulting RDD with into numPartitions
    +        partitions.
    +
    +        The values in the resulting RDD is iterable object L{ResultIterable},
    +        they can be iterated only once. The `len(values)` will result in
    --- End diff --
    
    This is a change from the old behavior.  Based on our discussion, I guess that we only
return a ResultIterable in cases where we spill and still return a list in the non-spilling
cases? 


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

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


Mime
View raw message