Created
October 13, 2016 00:11
-
-
Save milindjagre/037e5317f3f261729ae9704f8eb7cfe7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val input_file=sc.textFile("input.txt") | |
val step1=input_file.flatMap(line => line.split(" ")) | |
val step2=step1.map(word => (word,1)) | |
val step3=step2.reduceByKey(_+_) | |
step3.saveAsTextFile("wordcount") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the wordcount program which we run in spark shell