Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
val counts: DataStream[(String, Int)] = text
// split up the lines in pairs (2-tuples) containing: (word,1)
.map((_, 1))
// group by the tuple field "0" and sum up tuple field "1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment