Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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")
@milindjagre

This comment has been minimized.

Copy link
Owner Author

@milindjagre milindjagre commented Oct 13, 2016

This is the wordcount program which we run in spark shell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.