Skip to main content

AI-powered Apache Spark job analyzer and configuration advisor

Project description

↩ spark-advisor

spark-advisor-cli

AI-powered Apache Spark job analyzer and configuration advisor. Standalone CLI tool.

Stop guessing Spark configs. Let data and AI tell you what's wrong.

Install

pip install spark-advisor-cli

Quick Start

# Analyze from event log file (rules-only, free)
spark-advisor analyze /path/to/event-log.json.gz --no-ai

# Analyze with AI recommendations
export SA_ANALYZER_AI__API_KEY=sk-or-...
spark-advisor analyze /path/to/event-log.json.gz

# Analyze from History Server
spark-advisor analyze app-20250101120000-0001 -hs http://yarn:18080

# Agent mode (multi-turn AI analysis)
spark-advisor analyze /path/to/event-log.json.gz --agent

Commands

analyze — analyze a Spark job

# From event log file
spark-advisor analyze /path/to/event-log.json.gz

# From History Server
spark-advisor analyze app-20250101120000-0001 -hs http://yarn:18080

# With AI analysis (default if SA_ANALYZER_AI__API_KEY is set)
spark-advisor analyze /path/to/event-log.json.gz

# Without AI (rules only)
spark-advisor analyze /path/to/event-log.json.gz --no-ai

# Agent mode (multi-turn AI with tool use)
spark-advisor analyze /path/to/event-log.json.gz --agent

# Verbose mode (per-stage breakdown)
spark-advisor analyze /path/to/event-log.json.gz --verbose

# JSON output
spark-advisor analyze /path/to/event-log.json.gz --format json

# Save suggested config to file
spark-advisor analyze /path/to/event-log.json.gz -o spark-defaults.conf

# Use specific LLM model
spark-advisor analyze /path/to/event-log.json.gz --model qwen/qwen3-coder:free
Flag Short Default Description
source required App ID (with -hs) or path to event log file
--history-server -hs None Spark History Server URL
--no-ai False Disable AI analysis (rules only)
--agent False Use agent mode (multi-turn AI with tool use)
--model -m qwen/qwen3-coder:free LLM model for AI analysis
--output -o None Write suggested config to file
--format -f text Output format: text or json
--verbose -v False Show per-stage breakdown

scan — list recent jobs from History Server

spark-advisor scan -hs http://yarn:18080 --limit 20

version

spark-advisor version
# spark-advisor v0.1.10

What it detects

11 deterministic rules: data skew, disk spill, GC pressure, shuffle partitions, executor idle, task failures, small files, broadcast join threshold, serializer choice, dynamic allocation, memory overhead.

All thresholds are configurable via Thresholds model.

See also

License

Apache 2.0

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_advisor_cli-0.1.18.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

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

spark_advisor_cli-0.1.18-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file spark_advisor_cli-0.1.18.tar.gz.

File metadata

  • Download URL: spark_advisor_cli-0.1.18.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"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_advisor_cli-0.1.18.tar.gz
Algorithm Hash digest
SHA256 897a6219295f1eba03c23c67309b4a316a32453ccc4d0a1fe870ad507829743f
MD5 3db4c1babd16aa7a146b84cd5c661d21
BLAKE2b-256 83ded69e49a739c75816b810952b99208e3ec11e90453c382ad2bba29052deef

See more details on using hashes here.

File details

Details for the file spark_advisor_cli-0.1.18-py3-none-any.whl.

File metadata

  • Download URL: spark_advisor_cli-0.1.18-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"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_advisor_cli-0.1.18-py3-none-any.whl
Algorithm Hash digest
SHA256 ddcf9acaee5b2fb4fd88a6e63090afe21fa845c9d631da55a024d76d115e2120
MD5 2a97fee0c579c482e1dbd142d216d43a
BLAKE2b-256 0d74d24f8b91803a9a5d13f497b9b71d48c2425831a2b2126b1cb571d8e876d3

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