About this lab
You are a data engineer at StreamWave, a video streaming platform with a catalog of 10,000 titles and millions of viewing sessions per day. The content team needs weekly reports on watch-through rates, genre popularity by region, and churn risk signals, but the raw viewing logs are too large for BigQuery to transform cost-effectively in a single pass. Your team decides to use a Spark cluster to handle the heavy transformations before loading summarized results into BigQuery.
You will create a Dataproc cluster on Google Cloud, write PySpark jobs that read raw viewing logs from Cloud Storage, join them with content metadata, calculate engagement metrics and churn indicators, and write the results to BigQuery. You will also learn to tune Spark configurations for cost efficiency and compare Dataproc execution with equivalent BigQuery SQL.
Lab details
- Level: Intermediate
- Cloud: GCP
- Domain: Data Engineering
- Duration: 75 minutes
What you will learn
- Upload raw viewing log CSVs to Cloud Storage with an organized folder structure
- Create and configure a Dataproc cluster using the Google Cloud Console
- Write a PySpark job that joins datasets and calculates watch-through rates and engagement scores
- Submit PySpark jobs to Dataproc and monitor execution through the Jobs console
- Write Spark output directly to BigQuery tables using the BigQuery connector
- Compare Dataproc Spark execution with equivalent BigQuery SQL for the same transformations
Concepts covered
- Google Cloud Dataproc
- PySpark
- BigQuery
- Google Cloud Storage
- Batch Data Pipelines
- Churn Analytics
Technologies used
- Google Cloud Dataproc
- Google Cloud Storage
- BigQuery
- PySpark
- BigQuery Spark Connector
Prerequisites
- A Google Cloud account with billing enabled (Dataproc incurs compute costs)
- Basic understanding of Python and SQL
- Familiarity with Spark concepts (DataFrames, transformations, actions)
- Comfort navigating the Google Cloud Console
Topics
- GCP
- Dataproc
- PySpark
- BigQuery
- GCS
- Batch
- Spark
- Churn Analytics
- Engagement Metrics
- Data Engineering
- Intermediate