January 2019
Beginner to intermediate
154 pages
4h 31m
English
This applies a given function to each element of an RDD and returns a new RDD with the same number of elements. For example, in the following code, numbers from 1 to 10 are multiplied by the number 2:
#Pythonspark.sparkContext.parallelize(range(1,11)).map(lambda x : x * 2).collect()
The following code performs the same operation in Scala:
//Scalaspark.sparkContext.parallelize(1 to 10).map(_ * 2).collect()
Read now
Unlock full access