Github user nchammas commented on a diff in the pull request:
https://github.com/apache/spark/pull/218#discussion_r10913578
--- Diff: python/pyspark/rdd.py ---
@@ -202,6 +202,12 @@ def flatMap(self, f, preservesPartitioning=False):
def func(s, iterator): return chain.from_iterable(imap(f,
iterator))
return self.mapPartitionsWithIndex(func, preservesPartitioning)
+ def partitions(self):
+ """
+ Get the array of partitions of this RDD, taking into account
whether the RDD is checkpointed or not.
+ """
+ return self._jrdd.splits()
--- End diff --
Actually, I'm not sure that having a Python method return a Java object is
right thing to do. Or is it?
`len(rdd.partitions())` works as you would expect, and so does
`rdd.partitions().size()`, but I'm not sure how else this method might be used.
---
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.
---