Your PySpark playground

Online PySpark Compiler

Explore DataFrames, write transformations and practice SQL. No installation. Sign in to run code.

PySparkNotebook
Connecting…
NotebookDaily Challenge 1 cell

Session—
WorkspaceNotebook
Files0
DataFrames0
Notebook tools
Save & recover notebook

Explicit device save for your signed-in account. Code, languages and cell order only; no outputs or server variables. Later edits need another Save.

Drafts remain until you delete them or clear browser storage. Sign back into the same account to recover after logout or browser restart. No cloud sync: export/import to transfer between devices.

Keep exports private. Avoid secrets in code. Shared browser profiles can read local storage; account separation is not encryption. Logout hides the current notebook and discards unsaved edits.

Sign in to save or recover a device draft. Export/import also works without signing in.

Execution & resource limits

Production configuration verified 4 October 2026. Each interactive execution has a 120-second server budget; the browser waits up to 150 seconds including request overhead. Stop finishes the current cell before skipping the rest.

Code: 64,000 characters per cell. Printed output: 1,048,576 characters, then a truncation notice. Show a few rows or aggregate results instead of printing the whole dataset.

Uploads: the API accepts files up to 256 MiB, but its gateway limits the entire request to 100 MiB including multipart overhead. Use files below 100 MiB, split large files, or sample your data first.

Shared capacity: 3 PySpark runners and 4 Python workers. Each pool can queue 12 waiting requests for up to 20 seconds. If busy, wait briefly and retry once; repeated clicks do not increase capacity.

Per-runner memory: PySpark 720 MiB including Python and Java; Python 256 MiB. Sample or filter early, avoid collecting large DataFrames into Python, and rerun prerequisite cells if resource exhaustion restarts a session.

1
Add Cell:

Learn by doing

Practice PySpark with runnable examples

Choose a small, self-contained example. It opens in a new cell, so your existing code stays in place. Sign in and select Run to see the result.

Filter a DataFrame

Create a small dataset and keep the rows you need with a filter.

people = spark.createDataFrame(
    [("Ada", 32), ("Lin", 24)],
    ["name", "age"]
)
people.filter("age >= 30").show()

Then Run: One row: Ada, age 32.

The filter keeps only rows where age is at least 30. Lin is excluded.

Next exercise: Change the condition to age < 30. Predict the row, then run it.

Related challenge: Filter Rows with a Condition

Group and aggregate

Calculate totals by category with the PySpark DataFrame API.

from pyspark.sql import functions as F
sales = spark.createDataFrame(
    [("Books", 20), ("Books", 15)],
    ["category", "amount"]
)
sales.groupBy("category").agg(
    F.sum("amount").alias("total")
).show()

Then Run: One row: Books, total 35.

groupBy combines the two Books rows; sum adds 20 and 15.

Next exercise: Add a Toys row with amount 10. Predict the two grouped totals.

Related challenge: Count Rows per City

Query with Spark SQL

Register a DataFrame as a view, then query it inside a PySpark cell.

orders = spark.createDataFrame(
    [(1, 25), (2, 80)], ["id", "amount"]
)
orders.createOrReplaceTempView("orders")
spark.sql(
    "SELECT * FROM orders WHERE amount > 50"
).show()

Then Run: One row: id 2, amount 80.

The temporary view makes the DataFrame available to Spark SQL. WHERE filters its rows.

Next exercise: Change the query to SELECT SUM(amount) AS total FROM orders. Expect 105.

Related challenge: Select Two Columns from a DataFrame

Save explicitly in Notebook tools to recover code after refresh. Outputs and server variables are temporary. Execution and resource limits are listed in Notebook tools.

How to run PySpark online

Start with the example, sign in, then select Run or press Shift+Enter inside the editor. Add cells for each transformation; Run All executes in order and stops at the first error.

Open Data to upload and preview datasets or inspect session DataFrames. Python, Pandas, Matplotlib and NLP cells share the Python runtime. SQL cells use a separate SQLite database; use spark.sql() in a PySpark cell for Spark SQL.

Online PySpark compiler FAQ

What to expect from your notebook, SQL cells and execution session.

Do I need an account to run code?

Yes. You can explore the editor and examples before signing in. Sign in with Google to execute code and upload practice data. No local Spark installation is needed.

Is SQL the same as Spark SQL here?

SQL cells run in a separate SQLite database. To query a Spark DataFrame, create a temporary view and call spark.sql() inside a PySpark cell. SQLite tables and Spark views are separate.

Will my code survive a page refresh?

Use Notebook tools to explicitly Save on this device, then Recover after a refresh or signing back into the same account. Later edits need another Save. Device drafts do not sync automatically; export/import a private notebook JSON file to move code between devices. Outputs and server variables are not restored.

How does Stop work?

Stop skips the remaining cells in a batch after the current cell finishes. It does not immediately cancel a running backend operation. Run requests wait up to 150 seconds; use small, bounded examples for practice.

Can I run PySpark online without installing Spark?

Yes. This notebook lets you run PySpark in the browser, so you can test code, explore DataFrames, and practice transformations without a local Spark setup.

Is this useful for ETL pipeline practice?

Yes. Add cells to ingest sample or uploaded data, clean it, join tables and build aggregations in one notebook. Python and PySpark cells share variables; SQLite has its own tables.

What languages can I use in the notebook?

You can work with PySpark, Python, SQL, Pandas, Matplotlib, and NLP cells, which makes the page useful for end-to-end data engineering experiments.

Who should use this online compiler?

It is a strong fit for beginners learning Spark, data engineers prototyping ETL logic, and interview candidates who want a fast PySpark playground.