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

    https://github.com/apache/spark/pull/2274#discussion_r17200864
  
    --- Diff: python/pyspark/rdd.py ---
    @@ -515,6 +515,30 @@ def __add__(self, other):
                 raise TypeError
             return self.union(other)
     
    +    def repartitionAndSortWithinPartitions(self, numPartitions=None, 
partitionFunc=portable_hash,
    +                                           ascending=True, keyfunc=lambda 
x: x):
    +        """
    +        Repartition the RDD according to the given partitioner and, within 
each resulting partition,
    +        sort records by their keys.
    +
    +        >>> rdd = sc.parallelize([(0, 5), (3, 8), (2, 6), (0, 8), (3, 8), 
(1, 3)])
    +        >>> rdd2 = rdd.repartitionAndSortWithinPartitions(True, lambda x: 
x % 2, 2)
    --- End diff --
    
    Is this code actually correct? It seems to be passing arguments 3 and 4 of 
the function, but in positions 1 and 2.


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