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 comment has been minimized.
This is the wordcount program which we run in spark shell