超越文本到SQL:LLMs真的能调试企业级ETL SQL吗?
Beyond Text-to-SQL: Can LLMs Really Debug Enterprise ETL SQL?
AI总结:
本文提出OurBench基准测试,用于评估LLMs在企业级SQL推理和调试中的性能,发现现有模型在复杂SQL错误检测上表现有限,需进一步改进。
摘要:
SQL在企业数据工程中至关重要,但生成完全正确的SQL代码仍需多次调试迭代,即使对于有经验的开发者和高级文本到SQL LLMs也是如此。我们引入了OurBench,这是首个针对企业级SQL推理和调试的基准测试。该基准测试基于两个关键创新:(1)一个自动化构建工作流程,通过逆向工程系统性地将真实错误注入到大规模SQL代码中,从而实现可扩展且多样的基准测试生成;(2)一个无执行评估框架,专门针对企业环境,提供快速、准确且资源高效的评估。OurBench包含469个OurBenchSyn查询,这些查询包含带有明确错误信息的语法错误,以及516个OurBenchSem查询,这些查询针对语义错误,即代码未能满足用户意图。这些查询高度复杂,平均超过140行,具有深且宽的抽象语法树。对近30个LLM的评估揭示了显著的性能差距:表现最好的模型Claude-4-Sonnet在OurBenchSyn上仅达到36.46%的准确率,在OurBenchSem上达到32.17%的准确率,而大多数模型得分低于20%。我们进一步探索了四种解决方案策略,识别了关键挑战,并概述了利用LLMs进行企业SQL调试的有前途的方向。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。