RISE: Rule-Driven SQL Dialect Translation via Query Reduction
Xudong Xie, Yuwei Zhang, Wensheng Dou, Yu Gao, Ziyu Cui, Jiansen Song, Rui Yang, Jun Wei
Abstract
Translating SQL dialects across different relational database management systems (RDBMSs) is crucial for migrating RDBMS-based applications to the cloud. Traditional SQL dialect translation tools rely on manually-crafted rules, necessitating significant manual effort to support new RDBMSs and dialects. Although large language models (LLMs) can assist in translating SQL dialects, they often struggle with lengthy and complex SQL queries.
In this paper, we propose RISE, a novel LLM-based SQL dialect translation approach that can accurately handle lengthy and complex SQL queries. Given a complex source query ๐ ๐ that contains a SQL dialect ๐, we first employ a dialect-aware query reduction technique to derive a simplified query ๐ ๐ by removing ๐-irrelevant SQL elements from ๐ ๐ . Subsequently, we utilize LLMs to translate ๐ ๐ into ๐ ๐ โฒ , and automatically extract the translation rule ๐ ๐ for dialect ๐ based on the relationship between ๐ ๐ and ๐ ๐ โฒ . By applying ๐ ๐ to ๐ ๐ , we can effectively translate the dialect ๐ within ๐ ๐ , thereby bypassing the complexity of the source query ๐ ๐ . We evaluate RISE on two real-world benchmarks, i.e., TPC-DS and SQLProcBench, comparing its performance against both the traditional rule-based tools and the LLM-based approaches with respect to translation accuracy. RISE achieves accuracies of 97.98% on TPC-DS and 100% on SQLProcBench, outperforming the baselines by an average improvement of 24.62% and 238.41%, respectively.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext cb3bb1d0-a8a4-41eb-931a-7955e34ae6dfBuilds on8
- Procedural Extensions of SQL: Understanding their usage in the wildSurabhi Gupta, Karthik RamachandraVLDB 2021 ยท 34 citations
- Cracking SQL Barriers: An LLM-based Dialect Translation SystemWei Zhou, Yuyang Gao, Xuanhe Zhou, Guoliang LiSIGMOD 2025 ยท 14 citations
- LPR: Large Language Models-Aided Program ReductionMengxiao Zhang, Yongqiang Tian, Zhenyang Xu, Yiwen Dong et al.ISSTA 2024 ยท 13 citations
- PPR: Pairwise Program ReductionMengxiao Zhang, Zhenyang Xu, Yongqiang Tian, Yu Jiang et al.FSE 2023 ยท 13 citations
- VeriEQL: Bounded Equivalence Verification for Complex SQL Queries with Integrity ConstraintsYang He, Pinhan Zhao, Xinyu Wang, Yuepeng WangOOPSLA 2024 ยท 12 citations
Related papers
- DLBench: A Comprehensive Benchmark for SQL Translation with Large Language ModelsLi Lin, Hongqiao Chen, Qinglin Zhu, Liehang Chen et al.ASE 2025
- Dialect-Agnostic SQL Parsing via LLM-Based SegmentationJunwen An, Kabilan Mahathevan, Manuel RiggerSIGMOD 2026
- Dialect-SQL: An Adaptive Framework for Bridging the Dialect Gap in Text-to-SQLJie Shi, Xi Cao, Bo Xu, Jiaqing Liang et al.EMNLP 2025 ยท 2 citations
- The Power of Constraints in Natural Language to SQL TranslationTonghui Ren, Chen Ke, Yuankai Fan, Yinan Jing et al.VLDB 2025 ยท 4 citations
- SQLens: An End-to-End Framework for Error Detection and Correction in Text-to-SQLYue Gong, Chuan Lei, Xiao Qin, Kapil Vaidya et al.NeurIPS 2025 ยท 21 citations
