Files
Python-for-Geeks/Chapter9/pipeline/pipeline1.py
T
2021-06-15 23:10:30 +04:00

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))