Beyond Text-to-SQL: Can LLMs Really Debug Enterprise ETL SQL?

Jing Ye, Yiwen Duan, Yonghong Yu, Victor Ma, Yang Gao +1 more
1/26/2026
cs.AI

No confident code implementation found for this paper.

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{ye2026beyond,
  title  = {Beyond Text-to-SQL: Can LLMs Really Debug Enterprise ETL SQL?},
  author = {Jing Ye and Yiwen Duan and Yonghong Yu and Victor Ma and Yang Gao and Xing Chen},
  year   = {2026},
  eprint = {2601.18119},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2601.18119v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2601.18119.svg)](https://codeofpaper.com/paper/2601.18119)

Discussion