Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Fix the classtag bits
  • Loading branch information
holdenk committed Apr 8, 2014
commit b231375c92ecad85ed084e8a5a865c8eb495a4ee
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ trait JavaRDDLike[T, This <: JavaRDDLike[T, This]] extends Serializable {
* Return a new RDD by applying a function to each partition of this RDD, while tracking the index
* of the original partition.
*/
def mapPartitionsWithIndex[R: ClassTag](f: JFunction2[Integer, JIterator[T], JIterator[R]],
def mapPartitionsWithIndex[R](f: JFunction2[Integer, JIterator[T], JIterator[R]],
preservesPartitioning: Boolean = false): JavaRDD[R] = {
import scala.collection.JavaConverters._
def fn = (a: Int, b: Iterator[T]) => f.call(a, asJavaIterator(b)).asScala
val newRdd = rdd.mapPartitionsWithIndex(fn, preservesPartitioning)
val newRdd = rdd.mapPartitionsWithIndex(fn, preservesPartitioning)(fakeClassTag[R])
new JavaRDD(newRdd)(fakeClassTag)
}

Expand Down