Learn PySpark, SQL & Data Engineering

PySpark is the Python API for Apache Spark, the engine most data teams reach for once their data outgrows a single machine. Learning it means learning three things at once: the DataFrame API you write, the SQL that expresses the same ideas declaratively, and the way Spark distributes the work underneath. The guides below take them one at a time, each with code you can run in the browser compiler without installing anything. Nothing here assumes you have a cluster: every example runs on a single machine, which is enough to learn what the operations mean before you meet data large enough to punish getting them wrong.

Start with the DataFrame API

Most PySpark work is transforming DataFrames. Begin with select and filter to shape rows and columns, withColumn to derive new ones, then groupBy and join to combine data. Reading data comes up immediately too, which is what read.csv covers, along with fillna and dropDuplicates for the cleaning that always follows.

Then the parts that separate beginners from practitioners

Window functions answer questions about a row in the context of its neighbours — running totals, rankings, gaps between events — and they have a direct SQL equivalent worth knowing. repartition versus coalesce is where people first meet Spark's execution model, and UDFs are where they first pay for ignoring it. On the SQL side, common table expressions keep long queries readable, and orderBy is deceptively expensive at scale.

Where PySpark fits in a data platform

Spark rarely runs alone. Spark SQL is the same engine reached through queries; Structured Streaming applies it to unbounded data with watermarks and event-time windows; Delta Lake adds ACID transactions and time travel on top of the files Spark writes; and MLlib trains models on the same distributed data. If you are earlier than that, start with what data engineering actually is and ETL versus ELT.

Practise what you read

Reading about a shuffle is not the same as causing one. Each guide pairs with the coding challenges, which are graded against real Spark output, and with interview questions if you are preparing for a data engineering role.

All guides