Skip to main content

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

example 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

spark_plan_viz-0.2.1.tar.gz (286.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spark_plan_viz-0.2.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file spark_plan_viz-0.2.1.tar.gz.

File metadata

  • Download URL: spark_plan_viz-0.2.1.tar.gz
  • Upload date:
  • Size: 286.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"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

Hashes for spark_plan_viz-0.2.1.tar.gz
Algorithm Hash digest
SHA256 bd22218a78ffd93527bce2a065cad6845277ec299b14df5409d5e7cfabd0d275
MD5 e6529b845b8d3f8713f0985d3741f048
BLAKE2b-256 1415bbd6690f64208107d26be113f3fda7dad7044037c1ad045e683cface667e

See more details on using hashes here.

File details

Details for the file spark_plan_viz-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: spark_plan_viz-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"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

Hashes for spark_plan_viz-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 abdfc567fc607921454f663f26ab5f7a7a6c27590c29dfda2cf830336f9a36c8
MD5 b50048b274a3924dc6ad621dfb6dddf2
BLAKE2b-256 93313e33a9e687d225eb9d905f22bdfc71f4e138bfb5c745fe5a621fef92ebf2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page