Note that Spark shell is available only in the Scala language. However, we have kept examples easy to understand by Java developers.
Some basic exercises using Spark shell
Checking Spark version
Execute the following command to check the Spark version using spark-shell:
scala>sc.version
res0: String = 2.1.1
It is shown in the following screenshot:
Creating and filtering RDD
Let's start by creating an RDD of strings:
scala>val stringRdd=sc.parallelize(Array("Java","Scala","Python","Ruby","JavaScript","Java...