Applies a simple 1-to-1 mapping function over each element in the collection.
Example 1: providing the mapping function using a
Example 2: providing the mapping function using a
which allows the use of Java 8 lambdas. Due to type erasure, you need
to provide a hint indicating the desired return type.
- FlatMapElements behaves the same as
Map, but for each input it may produce zero or more outputs.
- Filter is useful if the function is just deciding whether to output an element or not.
- ParDo is the most general element-wise mapping operation, and includes other abilities such as multiple output collections and side-inputs.
Last updated on 2020/08/14
Have you found everything you were looking for?
Was it all useful and clear? Is there anything that you would like to change? Let us know!