Sample Word Count Program In Spark Scala
Sample Word Count Program In Spark Scala. Start spark interactive scala shell. Create an empty directory named sparkwordcount in your home directory, and enter it:

Here, pass any file name that .
In this example, we use a few transformations to build a dataset of (string, int) pairs called counts and then save it to a file. To start scala spark shell open a terminal and run the following command. Val counts = text.flatmap(line => line.split( ) ; · for the scala version, create the./com/cloudera/sparkwordcount .
