Skip to Content
Cloud Analytics with Google Cloud Platform
book

Cloud Analytics with Google Cloud Platform

by Sanket Thodge
April 2018
Beginner to intermediate content levelBeginner to intermediate
282 pages
9h 53m
English
Packt Publishing
Content preview from Cloud Analytics with Google Cloud Platform

Pipeline example

The following example is written in Java and shows constructing and running a pipeline with three transforms; they are:

  • Transform to read
  • Transform to count the data
  • Transform to write out the results of the data

The code for the same is as follows:

public static void main(String[] args) {           // create a pipeline parameterized by command-line flags            PipelineOptions options = PipelineOptionsFactory.fromArgs(args);            Pipeline p = Pipeline.create(options);            p.apply(TextIO.Read.from(“gs://...”))               // read input            p.apply(new CountWords())                           // do processing            p.apply(TextIO.Write.to(“gs://...”));               // write output            p.run();                                            // run the pipeline}
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Data Science on the Google Cloud Platform

Data Science on the Google Cloud Platform

Valliappa Lakshmanan
Hands-On Machine Learning on Google Cloud Platform

Hands-On Machine Learning on Google Cloud Platform

Giuseppe Ciaburro, V Kishore Ayyadevara, Alexis Perrier, Bryan Fry, Antonio Gulli
Google Cloud Cookbook

Google Cloud Cookbook

Rui Santos Costa, Drew Hodun

Publisher Resources

ISBN: 9781788839686Other