Your Python code steers a JVM through Py4J — see when data stays in the JVM and when it crosses into Python.
PySpark is a Python API over an engine written in Scala that runs on the JVM. When you create a SparkSession in Python, PySpark launches a JVM and connects to it with Py4J — a library that lets Python call methods on Java objects over a local socket.
So a PySpark driver is really two processes: your Python interpreter and a JVM driver. (Under spark-submit the order flips — the JVM starts first and launches your Python script — but you end up with the same pair.)
Reach the last step for the run summary: the key takeaways from this lesson.