scala> val rdd1 = sc.parallelize(List(1,2,3,4,5)) - Creating RDD
scala> val rdd2 = rdd1.map(x => (x+3)) - Creating new RDD from existing RDD "Transformation"
scala> rdd2.collect - Action will show the Array(4,5,6,7,8)
(it represent added by 3 with 1st rdd(rdd1), i,e (1+3), (2+3), (3+3) ....
Hope it helps!
If you want to know more about Apache Spark Scala, It's highly recommended to go for Apache Spark certification course today.
Thanks!!