Documentation ¶
Overview ¶
Package snippets contains code used in the Beam Programming Guide as examples for the Apache Beam Go SDK. These snippets are compiled and their tests run to ensure correctness. However, due to their piecemeal pedagogical use, they may not be the best example of production code.
The Beam Programming Guide can be found at https://beam.apache.org/documentation/programming-guide/.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountWords ¶
func CountWords(s beam.Scope, lines beam.PCollection) beam.PCollection
[START countwords_composite] CountWords is a function that builds a composite PTransform to count the number of times each word appears.
func CreateAndSplit ¶
func CreateAndSplit(s beam.Scope, input []stringPair) beam.PCollection
CreateAndSplit is a helper function that creates
func PipelineConstruction ¶
func PipelineConstruction()
PipelineConstruction contains snippets for the initial sections of the Beam Programming Guide, from initializing to submitting a pipeline.
func PipelineOptions ¶
func PipelineOptions()
PipelineOptions shows basic pipeline options using flags.
func PipelineOptionsCustom ¶
func PipelineOptionsCustom()
PipelineOptionsCustom shows slightly less basic pipeline options using flags.
Types ¶
type ComputeWordLengthFn ¶
type ComputeWordLengthFn struct{}
ComputeWordLengthFn is the DoFn to perform on each element in the input PCollection.
func (*ComputeWordLengthFn) ProcessElement ¶
func (fn *ComputeWordLengthFn) ProcessElement(word string, emit func(int))
ProcessElement is the method to execute for each element.