Created
October 28, 2011 04:51
-
-
Save johnynek/1321652 to your computer and use it in GitHub Desktop.
Wordcount in the scalding DSL for Cascading
This file contains hidden or 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
package com.twitter.scalding | |
class WordCount(args : Args) extends Job(args) { | |
TextLine( args("input") ).read. | |
flatMap('line -> 'word) { line : String => line.split("\\s+") }. | |
groupBy('word) { _.size }. | |
write( Tsv( args("output") ) ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment