In Built Functions
There are various functions in RDD transformation. Let us see RDD transformation with examples.
In Spark, the Map passes every component of the source through a capacity and structures a new dispersed dataset.
Illustration of Map work
In this model, we add a steady worth 10 to every component.
To open the spark in Scala mode, follow the beneath order
Make a RDD utilizing parallelized assortment.
scala> val data = sc.parallelize(List(10,20,30>
Now, we can read the generated result by using the following command.
Apply the guide capacity and pass the articulation expected to perform.
scala> val mapfunc = data.map(x => x+10>
Presently, we can peruse the created outcome by utilizing the accompanying order.