Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Data Engineering with Google Cloud Platform

You're reading from   Data Engineering with Google Cloud Platform A practical guide to operationalizing scalable data analytics systems on GCP

Arrow left icon
Product type Paperback
Published in Mar 2022
Publisher Packt
ISBN-13 9781800561328
Length 440 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Adi Wijaya Adi Wijaya
Author Profile Icon Adi Wijaya
Adi Wijaya
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Section 1: Getting Started with Data Engineering with GCP
2. Chapter 1: Fundamentals of Data Engineering FREE CHAPTER 3. Chapter 2: Big Data Capabilities on GCP 4. Section 2: Building Solutions with GCP Components
5. Chapter 3: Building a Data Warehouse in BigQuery 6. Chapter 4: Building Orchestration for Batch Data Loading Using Cloud Composer 7. Chapter 5: Building a Data Lake Using Dataproc 8. Chapter 6: Processing Streaming Data with Pub/Sub and Dataflow 9. Chapter 7: Visualizing Data for Making Data-Driven Decisions with Data Studio 10. Chapter 8: Building Machine Learning Solutions on Google Cloud Platform 11. Section 3: Key Strategies for Architecting Top-Notch Data Pipelines
12. Chapter 9: User and Project Management in GCP 13. Chapter 10: Cost Strategy in GCP 14. Chapter 11: CI/CD on Google Cloud Platform for Data Engineers 15. Chapter 12: Boosting Your Confidence as a Data Engineer 16. Other Books You May Enjoy

Building an ephemeral cluster using Dataproc and Cloud Composer

Another option to manage ephemeral clusters is using Cloud Composer. We learned about Airflow in the previous chapter to orchestrate BigQuery data loading. But as we've already learned, Airflow has many operators and one of them is of course Dataproc. 

You should use this approach compared to a workflow template if your jobs are complex, in terms of developing a pipeline that contains many branches, backfilling logic, and dependencies to other services, since workflow templates can't handle these complexities.

In this section, we will use Airflow to create a Dataproc cluster, submit a pyspark job, and delete the cluster when finished.

Check the full code in the GitHub repository:

Link to be updated

To use the Dataproc operators in Airflow, we need to import the operators, like this:

from airflow.providers.google.cloud.operators.dataproc import (
    DataprocCreateClusterOperator...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image