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

    https://github.com/apache/spark/pull/1977#discussion_r27998013
  
    --- Diff: python/pyspark/rdd.py ---
    @@ -1755,21 +1753,33 @@ 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 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 --
    
    Is this still true?  
[Upthread](https://github.com/apache/spark/pull/1977#issuecomment-56004283), 
you mentioned that this can now be iterated multiple times, so we should 
probably update this comment.  It would also be nice to add a unit test to 
illustrate that the calling `len(values)` then reading the values will work, 
even if it's inefficient (you might have already done this in tests, though; I 
haven't checked).


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

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

Reply via email to