Created
June 14, 2017 10:53
-
-
Save saisgit/d4e5904ac9c50cef4d1f97484b5d9e82 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 textFile = sc.textFile("hdfs://...") | |
val counts = textFile.flatMap(line => line.split(" ")) | |
.map(word => (word, 1)) | |
.reduceByKey(_ + _) | |
counts.saveAsTextFile("hdfs://...") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment