$ hdfs dfs -put /home/codegyani/sparkdata.txt /spark Now, follow the below command to open the spark in Scala mode.$ spark-shell Let's create an RDD by using the following command.scala> val data=sc.textFile("sparkdata.txt"); ...
In Spark, the Distinct function returns the distinct elements from the provided dataset. Example of Distinct function In this example, we ignore the duplicate elements and retrieves only the distinct elements. To open the spark in Scala mode, follow the below command. $ spark-shell Create an R...