Menu
CoddyTech

What Is PySpark?

Part of the Fundamentals section of Coddy's PySpark journey. Lesson 1 of 18.

PySpark is the Python interface to Apache Spark. You describe a data transformation in Python, and Spark executes a plan. A DataFrame is a table with named columns and a schema. Spark can distribute work across a cluster; these exercises use real Spark locally with small datasets.

This section assumes you already know Python variables, functions and lists. Run the prepared program. It creates three numbered rows, counts them, and stops the session.

challenge icon

Challenge

Beginner

Run the prepared program. It prints 3, the number of rows.

Try it yourself

from pyspark.sql import SparkSession
spark = SparkSession.builder.appName("Learning").getOrCreate()
print(spark.range(3).count())
spark.stop()

All lessons in Fundamentals

Practice on your own: Online Python compiler