...

Cloud Computing - RDD SPARK

Back to Course

Lesson Description


Lession - #1474 Map Functions


In Built Functions

There are various functions in RDD transformation. Let us see RDD transformation with examples.

Map Function

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


$ spark-shell

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.

scala> data.collect

    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.
scala> mapfunc.collect