Created
July 5, 2015 16:12
-
-
Save bruckhaus/5796aa4ac7ff48c6cfde to your computer and use it in GitHub Desktop.
Word Count in Flink Scala
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
case class Word (word: String, frequency: Int) | |
val counts = text | |
.flatMap {line => line.split(" ").map(word => Word(word,1))} | |
.groupBy("word").sum("frequency") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment