Skip to content
Snippets Groups Projects
Commit 74f710f6 authored by Holden Karau's avatar Holden Karau
Browse files

Start of working on SPARK-615

parent a310de69
No related branches found
No related tags found
No related merge requests found
......@@ -67,6 +67,14 @@ trait JavaRDDLike[T, This <: JavaRDDLike[T, This]] extends Serializable {
def map[R](f: JFunction[T, R]): JavaRDD[R] =
new JavaRDD(rdd.map(f)(f.returnType()))(f.returnType())
/**
* Return a new RDD by applying a function to each partition of this RDD, while tracking the index
* of the original partition.
*/
def mapPartitionsWithIndex(f: JFunction2[Int, T, R],
preservesPartitioning: Boolean = false): JavaRDD[R] =
new JavaRDD(MapPartitionsWithIndexRDD(this, sc.clean(f), preservesPartitioning))
/**
* Return a new RDD by applying a function to all elements of this RDD.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment