November 2017
Beginner to intermediate
290 pages
7h 34m
English
Now that we have introduced the big picture and concepts of Beam, we'll walk through the basic example of Beam WordCount in Java, run it first in a testing runner, and later on Apex. Since you have already seen this on Apex elsewhere in the book, we will jump right into the Beam code.
Here is the entirety of the example we call minimal word count:
PipelineOptions options = ...
Pipeline pipeline = Pipeline.create(options);
pipeline
.begin()
// Read some data (parallel connector that ships with Beam)
.apply(TextIO.read().from("gs://apache-beam-samples/shakespeare/*"))\
// Split into "words" (elementwise transform)
.apply(FlatMapElements
.into(TypeDescriptors.strings())
.via((String word) -> Arrays.asList(word.split("[^\\p{L}]+")))) ...Read now
Unlock full access