spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pwendell <...@git.apache.org>
Subject [GitHub] spark pull request: Spark-1163, Added missing Python RDD functions
Date Sat, 08 Mar 2014 19:47:24 GMT
Github user pwendell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/92#discussion_r10410791
  
    --- Diff: python/pyspark/rdd.py ---
    @@ -1057,6 +1058,64 @@ def coalesce(self, numPartitions, shuffle=False):
             jrdd = self._jrdd.coalesce(numPartitions)
             return RDD(jrdd, self.ctx, self._jrdd_deserializer)
     
    +    def name(self):
    +        """
    +        Return the name of this RDD.
    +        """
    +        name_ = self._jrdd.name()
    +        if not name_:
    +            return None
    +        return name_.encode('utf-8')
    +
    +    def setName(self, name):
    +        """
    +        Assign a name to this RDD.
    +        >>> rdd1 = sc.parallelize([1,2])
    +        >>> rdd1.setName('RDD1')
    +        >>> rdd1.name()
    +        'RDD1'
    +        """
    +        self._jrdd.setName(name)
    +
    +    def generator(self):
    --- End diff --
    
    @mateiz - are you sure we want this function? It might be good to delay adding this to
pyspark pending a clean-up of the `generator` stuff which I think is mostly redundant with
the callsite/origin.


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

Mime
View raw message