Beyond Text-to-SQL: Can LLMs Really Debug Enterprise ETL SQL?
Not on the map. Why?
Abstract (arXiv)
SQL is central to enterprise data engineering, yet generating fully correct SQL code in a single attempt remains difficult, even for experienced developers and advanced text-to-SQL LLMs, often requiring multiple debugging iterations. We introduce OurBench, the first benchmark for enterprise-level SQL reasoning and debugging. Our benchmark is built on two key innovations: (1) an automated construction workflow that uses reverse engineering to systematically inject realistic bugs into large-scale SQL code, enabling scalable and diverse benchmark generation; and (2) an execution-free evaluation framework tailored to enterprise settings, providing fast, accurate, and resource-efficient assessment. OurBench comprises 469 OurBenchSyn queries featuring syntax errors with explicit error messages, and 516 OurBenchSem queries targeting semantic errors in which the code fails to meet user intent. The queries are highly complex, averaging over 140 lines and featuring deep and wide abstract syntax trees. Evaluation of nearly 30 LLMs reveals a substantial performance gap: the best-performing model, Claude-4-Sonnet, achieves only 36.46 percent accuracy on OurBenchSyn and 32.17 percent on OurBenchSem, while most models score below 20 percent. We further explore four solution strategies, identify key challenges, and outline promising directions for enterprise SQL debugging with LLMs.
Key facts. No citing papers in the map yet (data through 13 Oct 2026). Builds on 35 of its 48 references that are in the map. First posted on arXiv 26 Jan 2026.
Builds on
35 of 48 references.
References · 35
- 2025Qwen3 Technical Reportcited by 8,510
- 2021Evaluating Large Language Models Trained on Codecited by 8,205
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,831
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,274
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 1,951
- 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineeringcited by 1,676
- 2024LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Modelscited by 1,450
- 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,133
- 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agentscited by 977
- 2023Teaching Large Language Models to Self-Debugcited by 972
- 2017Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learningcited by 687
- 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 680
23 more
- 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 533
- 2025LLMs Get Lost In Multi-Turn Conversationcited by 418
- 2024Agentless: Demystifying LLM-based Software Engineering Agentscited by 414
- 2024Training Software Engineering Agents and Verifiers with SWE-Gymcited by 315
- 2024AutoCodeRover: Autonomous Program Improvementcited by 274
- 2025SWE-smith: Scaling Data for Software Engineering Agentscited by 263
- 2024RepairAgent: An Autonomous, LLM-Based Agent for Program Repaircited by 229
- 2024Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflowscited by 229
- 2024CodeR: Issue Resolving with Multi-Agent and Task Graphscited by 91
- 2025OmniSQL: Synthesizing High-quality Text-to-SQL Data at Scalecited by 91
- 2025Understanding Software Engineering Agents: A Study of Thought-Action-Result Trajectoriescited by 80
- 2021Break-It-Fix-It: Unsupervised Learning for Program Repaircited by 71
- 2021Self-Supervised Bug Detection and Repaircited by 59
- 2024Lingma SWE-GPT: An Open Development-Process-Centric Language Model for Automated Software Improvementcited by 59
- 2024FullStack Bench: Evaluating LLMs as Full Stack Coderscited by 57
- 2025Seed-Coder: Let the Code Model Curate Data for Itselfcited by 46
- 2018Apache Calcite: A Foundational Framework for Optimized Query Processing Over Heterogeneous Data Sourcescited by 24
- 2025AutoCodeBench: Large Language Models are Automatic Code Benchmark Generatorscited by 24
- 2025SWE-Synth: Synthesizing Verifiable Bug-Fix Data to Enable Large Language Models in Resolving Real-World Bugscited by 22
- 2025SWE-SQL: Illuminating LLM Pathways to Solve User SQL Issues in Real-World Applicationscited by 16
- 2025SQLens: An End-to-End Framework for Error Detection and Correction in Text-to-SQLcited by 12
- 2023CoCA: Fusing Position Embedding with Collinear Constrained Attention in Transformers for Long Context Window Extendingcited by 6
- 2024PDC & DM-SFT: A Road for LLM SQL Bug-Fix Enhancingcited by 2
Built on by
Not cited yet.