Skip to content

Instantly share code, notes, and snippets.

@stathissideris
Created March 15, 2017 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stathissideris/12f5a65b047b9b5c0636f78e5f145965 to your computer and use it in GitHub Desktop.
Save stathissideris/12f5a65b047b9b5c0636f78e5f145965 to your computer and use it in GitHub Desktop.
(let [p (Pipeline/create (PipelineOptionsFactory/create))]
(doto
(.. p
(apply TextIO.Read/from ("..."))
(apply "ExtractWords"
(ParDo/of (reify DoFn
(processElement [this context]
...
))))
(apply (Count/perElement))
(apply "FormatResults"
(MapElements/via (reify SimpleFuntion
(apply [this input]
...))))
(apply (TextIO.Write/to "wordcounts")))
(.. run waitUntilFinish)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment