FlatMapElements

The Beam SDKs provide language-specific ways to simplify how you provide your DoFn implementation.

FlatMap can be used to simplify DoFn that maps an element to multiple elements (one to many).

Kata: Implement a function that maps each input sentence into words tokenized by whitespace (" ") using FlatMap.


Use FlatMap with a lambda.
Refer to the Beam Programming Guide "Lightweight DoFns and other abstractions" section for more information.