Created
April 10, 2016 14:29
-
-
Save cerisier/b984def4e745e954cdc0b987c49f8056 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Return a new RDD by applying a function to all elements of this RDD. | |
*/ | |
def map[U: ClassTag](f: T => U): RDD[U] = withScope { | |
val cleanF = sc.clean(f) | |
new MapPartitionsRDD[U, T](this, (context, pid, iter) => iter.map(cleanF)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment