A tool to visualize Apache Spark execution plans.
Project description
Spark Plan Viz ⚡
A lightweight, interactive tool to visualize PySpark execution plans using D3.js. It helps developers and data engineers debug complex queries when the textual result of df.explain() is not enough. It helps identifying bottlenecks (Sorts, Shuffles), and displaying runtime metrics (AQE).
Features
- Interactive Tree: Zoom, pan, and collapse nodes.
- Metric Insights: Click nodes to see runtime metrics (rows output, spill size, etc.).
- Jupyter Integration: Renders directly inside notebooks without external files.
- Zero Dependencies: Only requires Pyspark.
- AQE Support: Visualizes Adaptive Query Execution details.
Installation
pip install spark-plan-viz
Usage
In a Jupyter Notebook
from spark_plan_viz import visualize_plan
# Assuming 'df' is your PySpark DataFrame
visualize_plan(df, notebook=True)
Export to HTML
from spark_plan_viz import visualize_plan
# Generates a standalone HTML file
visualize_plan(df, output_file="my_query_plan.html", open_browser=True)
How to read the chart
- Red nodes: Exchange/Shuffle (Network heavy)
- Purple Nodes: Joins
- Green Nodes: Scans (Data Ingestion)
- Blue Nodes: Aggregations
Example visualization
Here's an example screenshot of the visualization
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spark_plan_viz-0.2.2.tar.gz.
File metadata
- Download URL: spark_plan_viz-0.2.2.tar.gz
- Upload date:
- Size: 360.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4ce118902b7d1ccd1c42f3061369329c6efaf0080e4baa588b30dbf924aab69
|
|
| MD5 |
cdf51f44197386daabfe80f9e293e39b
|
|
| BLAKE2b-256 |
8bea14bf3cab4f46f0778339908af8cd39f70bbe3b66bdf1bf85148c25ec2996
|
File details
Details for the file spark_plan_viz-0.2.2-py3-none-any.whl.
File metadata
- Download URL: spark_plan_viz-0.2.2-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac638bc21d27bad1f2b60498d4bf1bf4b5242a20f67ac4d80ed8ee48a3bbc8be
|
|
| MD5 |
caf3dd4725db861130776375897630f3
|
|
| BLAKE2b-256 |
8f2c41b64a036497dfb4b676d4e1c0af831fdf66502a23730bd76c71bf15e4bc
|