Files
Python-for-Geeks/Chapter09/pipeline/pipeline1.py
T
2021-08-13 11:44:51 +05:30

12 lines
322 B
Python

#pipeline1.py: Separate strings from a PCollection
import apache_beam as beam
with beam.Pipeline() as pipeline:
plants = (
pipeline
| 'Subjects' >> beam.Create([
'English Maths Science',
'French Arts',
])
| 'Split subjects' >> beam.FlatMap(str.split)
| beam.Map(print))