Understanding, Detecting, and Repairing Real-World In-Context-Learning-Based Text-to-SQL Errors

Large language models (LLMs) have been adopted for text-to-SQL tasks, utilizing their in-context learning (ICL) capability to translate natural language questions into SQL queries. However, such a technique faces correctness problems. In this paper, we conduct the first comprehensive study of text-to-SQL errors of ICL-based techniques. Our study covers four representative ICL-based techniques, five basic repairing methods, two benchmarks, and two LLM settings. We find that text-to-SQL errors are widespread and summarize 27 error types of 7 categories. We also find that existing repairing attempts have limited correctness improvement while having high computational overhead and many mis-repairs. Based on these findings, we propose MapleDoctor, a novel text-to-SQL error detection and repairing framework. The evaluation demonstrates that MapleDoctor outperforms existing solutions by repairing 13.8% more queries with a negligible number of mis-repairs and reducing 67.4% repair latency. The artifact is publicly available at GitHub.

Authors

Institutions

Publication Details

Journal
Proceedings of the ACM on software engineering.
Published
2026-06-30
DOI
https://doi.org/10.1145/3808171
Primary Topic
Cloud Computing and Resource Management
Type
preprint
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

Understanding, Detecting, and Repairing Real-World In-Context-Learning-Based Text-to-SQL Errors

Chengcheng Wan, Jiazhen Zou, Geguang Pu, Yuchen Shao et al.
Proceedings of the ACM on software engineering.
Cloud Computing and Resource Management
preprint

Understanding, Detecting, and Repairing Real-World In-Context-Learning-Based Text-to-SQL Errors

Chengcheng Wan, Jiazhen Zou, Geguang Pu, Yuchen Shao, Jiawei Shen, Yueling Zhang, Hang Xu, Weikai Miao
preprint en

Abstract

Large language models (LLMs) have been adopted for text-to-SQL tasks, utilizing their in-context learning (ICL) capability to translate natural language questions into SQL queries. However, such a technique faces correctness problems. In this paper, we conduct the first comprehensive study of text-to-SQL errors of ICL-based techniques. Our study covers four representative ICL-based techniques, five basic repairing methods, two benchmarks, and two LLM settings. We find that text-to-SQL errors are widespread and summarize 27 error types of 7 categories. We also find that existing repairing attempts have limited correctness improvement while having high computational overhead and many mis-repairs. Based on these findings, we propose MapleDoctor, a novel text-to-SQL error detection and repairing framework. The evaluation demonstrates that MapleDoctor outperforms existing solutions by repairing 13.8% more queries with a negligible number of mis-repairs and reducing 67.4% repair latency. The artifact is publicly available at GitHub.

Proceedings of the ACM on software engineering.Vol. 3(FSE)
Shanghai Innovative Research Center of Traditional Chinese Medicine (CN), East China Normal University (CN)
National Natural Science Foundation of China
Openalex Percentile: Top 100%
Cloud Computing and Resource Management
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Understanding, Detecting, and Repairing Real-World In-Context-Learning-Based Text-to-SQL Errors — Chengcheng Wan, Jiazhen Zou, et al. · Proceedings of the ACM on software engineering. (2026) | TGRS Research Map | TGRS