Using LLMs to Analyze Spark SQL Plans: A Practical Approach to Debugging Long-Running Jobs

Using LLMs to Analyze Spark SQL Plans: A Practical Approach to Debugging Long-Running Jobs

Using LLMs to Analyze Spark SQL Plans: A Practical Approach to Debugging Long-Running Jobs

Original URL: https://medium.com/expedia-group-tech/using-llms-to-analyze-spark-sql-plans-a-practical-approach-to-debugging-long-running-jobs-35eace7eeec4

Article Written: June 30, 2026

Added: July 13, 2026

Type: tech2

Summary

The article discusses the challenges of debugging long-running Spark SQL jobs and presents an automated workflow powered by large language models (LLMs) to analyze Spark SQL execution plans. It highlights common performance anti-patterns such as missed broadcast joins, skewed partitions, and oversized broadcasts, providing concrete examples of how the LLM identifies these issues. The authors share their approach to creating structured prompts for the LLM and the significant improvements in job runtimes and cost reductions achieved through this method. This innovative approach aims to enhance the efficiency of Spark engineers by automating the triage process.

💭 Your Thoughts

if you have structured input + explicit rule, using LLM to analyise is usually good. their Spark job performance analsyise is a very good use case I think.

Technologies Referenced