Batch Processing

Process taxi data at scale with Spark, PySpark, and Spark SQL.

16 lessons · 3 h 49 min · homework closed Mar 1, 2027

Lessons

Units

  1. Introduction to Batch Processing

    Define batch processing, contrast it with streaming, and see where Spark fits among batch tools.

    10 min
  2. Introduction to Spark

    Explain what Spark is, which languages it supports, and when to use it instead of SQL on a data lake.

    7 min
  3. Installing Spark

    Install Java and Spark on a Linux machine, then run spark-shell and PySpark with a local SparkSession.

    14 min
  4. First Look at Spark/PySpark

    Read a large CSV with an explicit schema, repartition it, and write it as parquet while watching the Spark UI.

    18 min
  5. Spark DataFrames

    Work with Spark DataFrames, including parquet schemas, select and filter, lazy transformations versus actions, and UDFs.

    14 min
  6. Preparing Yellow and Green Taxi Data

    Prepare yellow and green taxi CSVs for 2020 and 2021 by downloading them and rewriting them as typed parquet.

    25 min
  7. SQL with Spark

    Combine green and yellow taxi data in Spark, register it as a temp table, and run the revenue report in Spark SQL.

    16 min
  8. Anatomy of a Spark Cluster

    Describe the parts of a Spark cluster, including the driver, master, and executors, and why HDFS became less common.

    7 min
  9. GroupBy in Spark

    Trace how Spark executes a GROUP BY in two stages, with a per-partition aggregate and a reshuffle by key.

    15 min
  10. Joins in Spark

    Compare sort merge joins for two large tables with broadcast joins for a large table and a small lookup table.

    17 min
  11. Operations on Spark RDDs

    Rebuild the green revenue query with RDD filter, map, and reduceByKey, then convert the result back to a DataFrame.

    24 min
  12. Spark RDD mapPartition

    Use mapPartitions to apply a model to each partition of a taxi dataset as a pandas DataFrame.

    17 min
  13. Connecting to Google Cloud Storage

    Upload taxi parquet files to Google Cloud Storage and configure a local Spark session to read from the bucket.

    9 min
  14. Creating a Local Spark Cluster

    Run a standalone Spark cluster with a master and worker, convert the notebook to a script, and submit it with spark-submit.

    15 min
  15. Setting up a Dataproc Cluster

    Create a Dataproc cluster and submit the Spark job from the web UI and with gcloud, after granting the needed role.

    12 min
  16. Connecting Spark to BigQuery

    Write Spark job output directly to a BigQuery table using the BigQuery connector and a temporary GCS bucket.

    9 min

Homework

Recordings, code and notes

Optional analytics

Optional analytics are off unless you allow them. Your choice does not affect access to DataTalks.Club, Slack, events, or courses.

Current choice: not chosen.

Privacy Policy

If you allow analytics, self-hosted Umami counts anonymous public pageviews without analytics cookies. Private account and learning pages are excluded. Read the Privacy Policy for the complete data boundary.