Created
March 15, 2017 09:00
-
-
Save stathissideris/12f5a65b047b9b5c0636f78e5f145965 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
(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
Quick translation of this: https://github.com/apache/beam/blob/master/examples/java/src/main/java/org/apache/beam/examples/MinimalWordCount.java