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
摘要
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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
脉络
它引用的 Paper8
- Procedural Extensions of SQL: Understanding their usage in the wildSurabhi Gupta, Karthik RamachandraVLDB 2021 · 34 次引用
- Cracking SQL Barriers: An LLM-based Dialect Translation SystemWei Zhou, Yuyang Gao, Xuanhe Zhou, Guoliang LiSIGMOD 2025 · 14 次引用
- LPR: Large Language Models-Aided Program ReductionMengxiao Zhang, Yongqiang Tian, Zhenyang Xu, Yiwen Dong 等ISSTA 2024 · 13 次引用
- PPR: Pairwise Program ReductionMengxiao Zhang, Zhenyang Xu, Yongqiang Tian, Yu Jiang 等FSE 2023 · 13 次引用
- VeriEQL: Bounded Equivalence Verification for Complex SQL Queries with Integrity ConstraintsYang He, Pinhan Zhao, Xinyu Wang, Yuepeng WangOOPSLA 2024 · 12 次引用
相关 Paper
- DLBench: A Comprehensive Benchmark for SQL Translation with Large Language ModelsLi Lin, Hongqiao Chen, Qinglin Zhu, Liehang Chen 等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 等EMNLP 2025 · 2 次引用
- The Power of Constraints in Natural Language to SQL TranslationTonghui Ren, Chen Ke, Yuankai Fan, Yinan Jing 等VLDB 2025 · 4 次引用
- SQLens: An End-to-End Framework for Error Detection and Correction in Text-to-SQLYue Gong, Chuan Lei, Xiao Qin, Kapil Vaidya 等NeurIPS 2025 · 21 次引用
