# Mastering Apache Spark Day1 Lab

> In this lab, Zach explains how Spark join types and shuffle behavior affect performance, using Spark UI, query plans, and Delta table experiments. It covers ingesting approximately 200,000 rows from Polygon/Massive into a Delta table, then examines an intraday self-join for best and worst trading d…

- Web page: https://www.dataexpert.io/lesson/mastering-apache-spark-day1-lab-4028
- Program: [Winter 2027 Databricks AI Data Engineer Boot Camp](https://www.dataexpert.io/program/databricks-ai-data-engineer-boot-camp-1198.md)
- Access: Requires enrollment in Winter 2027 Databricks AI Data Engineer Boot Camp
- Length: 1 h 2 min video
- Skills: Python, Data Modeling, ETL/ELT, Apache Spark, Data Visualization, Git, Delta Lake
- Academy: DataExpert.io Academy

## About this lesson

In this lab, Zach explains how Spark join types and shuffle behavior affect performance, using Spark UI, query plans, and Delta table experiments. It covers ingesting approximately 200,000 rows from Polygon/Massive into a Delta table, then examines an intraday self-join for best and worst trading days for Apple, including how broadcast joins can avoid shuffle but window functions with order by introduce additional sort and shuffle. He also compares repartition versus coalesce and different partition strategies on a 38 million row tweets dataset, showing how partition counts and defaults like auto change runtime, and discusses skew versus shuffle with adaptive query execution. He concludes with guidance on when repartitioning is likely unnecessary for well-modeled Delta inputs and when it can help for less structured sources.

## Navigation

- Previous lesson: [Building AI agents that provide business value](https://www.dataexpert.io/lesson/building-ai-agents-that-provide-business-value-144.md)
- Next lesson: [Processing terabytes of data with Spark](https://www.dataexpert.io/lesson/processing-terabytes-of-data-with-spark-9371.md)
