You are just performing a transformation(map). In order to view the contents of an RDD, you need to perform actions on the RDDs.
One way is to use collect():
myRDD.collect().foreach(println)
Though it will work finely, when the RDD has billions of lines, collect() won’t be a good option.
You can use take() instead. It will display the result in very less time:
myRDD.take(n).foreach(println)
If you want to know more about Spark, then do check out this awesome video tutorial: