Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ trait JavaRDDLike[T, This <: JavaRDDLike[T, This]] extends Serializable {

def rdd: RDD[T]

/** Set of partitions in this RDD. */
@deprecated("Use partitions instead.", "1.0.1")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be 1.1.0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed this when merging.

def splits: JList[Partition] = new java.util.ArrayList(rdd.partitions.toSeq)

/** Set of partitions in this RDD. */
def partitions: JList[Partition] = new java.util.ArrayList(rdd.partitions.toSeq)

/** The [[org.apache.spark.SparkContext]] that this RDD was created on. */
def context: SparkContext = rdd.context
Expand Down
2 changes: 1 addition & 1 deletion python/pyspark/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def runJob(self, rdd, partitionFunc, partitions = None, allowLocal = False):
[0, 1, 16, 25]
"""
if partitions == None:
partitions = range(rdd._jrdd.splits().size())
partitions = range(rdd._jrdd.partitions().size())
javaPartitions = ListConverter().convert(partitions, self._gateway._gateway_client)

# Implementation note: This is implemented as a mapPartitions followed
Expand Down
2 changes: 1 addition & 1 deletion python/pyspark/rdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ def take(self, num):
[91, 92, 93]
"""
items = []
totalParts = self._jrdd.splits().size()
totalParts = self._jrdd.partitions().size()
partsScanned = 0

while len(items) < num and partsScanned < totalParts:
Expand Down