From the course: Data Science on Google Cloud Platform: Building Data Pipelines

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Writing data to text files

Writing data to text files - Google Cloud Tutorial

From the course: Data Science on Google Cloud Platform: Building Data Pipelines

Start my 1-month free trial

Writing data to text files

- [Instructor] In this video, I will discuss writing PCollections to text files in Apache Beam. You will continue to use Beam's I/O package for this purpose too. We will write the PCollection custTypeCount to a text file in Google Cloud Storage in this example. Let us look at the code now. The code for this is available in line number 112. We use the beam.io.WriteText to write the custTypeCount PCollection to a file in Google Cloud Storage called customertype-summary.txt. Let us first execute this code. The code is now executed. Let us now go back to the console for Google Cloud Storage and see if the file that we have created is there. We see that the file custtype-summary.txt is now created with the customertype-summary. On opening the file, you can see that the customer summary is stored as a text file on Google Cloud Storage.

Contents