Created
February 1, 2021 23:52
-
-
Save JnsFerreira/9a2abfa0dde0e02bde804c949e310fbc to your computer and use it in GitHub Desktop.
Using map in Apache Beam
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import apache_beam as beam | |
with beam.Pipeline() as pipeline: | |
plants = ( | |
pipeline | |
| 'Gardening plants' >> beam.Create([ | |
' 🍓Strawberry \n', | |
' 🥕Carrot \n', | |
' 🍆Eggplant \n', | |
' 🍅Tomato \n', | |
' 🥔Potato \n', | |
]) | |
| 'Strip' >> beam.Map(str.strip) | |
| beam.Map(print)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment