PARROT: Un Benchmark per Valutare i Modelli Linguistici di Grandi Dimensioni nella Traduzione SQL tra Sistemi Diversi
PARROT: A Benchmark for Evaluating LLMs in Cross-System SQL Translation
September 27, 2025
Autori: Wei Zhou, Guoliang Li, Haoyu Wang, Yuxing Han, Xufei Wu, Fan Wu, Xuanhe Zhou
cs.AI
Abstract
I grandi modelli linguistici (LLM) hanno dimostrato un'efficacia crescente nei compiti di Text-to-SQL. Tuttavia, un altro problema strettamente correlato, la traduzione Cross-System SQL (nota anche come SQL-to-SQL), che adatta una query scritta per un sistema di database (ad esempio, MySQL) nella sua equivalente per un altro sistema (ad esempio, ClickHouse), è di grande importanza pratica ma rimane poco esplorato. Gli attuali benchmark SQL non sono adatti per la valutazione SQL-to-SQL, poiché (1) si concentrano su un insieme limitato di sistemi di database (spesso solo SQLite) e (2) non possono catturare molti dialetti SQL specifici del sistema (ad esempio, funzioni personalizzate, tipi di dati e regole sintattiche). Pertanto, in questo articolo, introduciamo PARROT, un benchmark pratico e realistico per la traduzione Cross-System SQL. PARROT comprende 598 coppie di traduzioni provenienti da 38 benchmark open-source e servizi aziendali reali, specificamente preparati per mettere alla prova la comprensione SQL specifica del sistema (ad esempio, gli LLM raggiungono una precisione media inferiore al 38,53%). Forniamo anche diverse varianti del benchmark, tra cui PARROT-Diverse con 28.003 traduzioni (per test sintattici estesi) e PARROT-Simple con 5.306 campioni rappresentativi (per test di stress mirati), coprendo 22 sistemi di database di livello produttivo. Per promuovere la ricerca futura, rilasciamo una classifica pubblica e il codice sorgente all'indirizzo: https://code4db.github.io/parrot-bench/.
English
Large language models (LLMS) have shown increasing effectiveness in
Text-to-SQL tasks. However, another closely related problem, Cross-System SQL
Translation (a.k.a., SQL-to-SQL), which adapts a query written for one database
system (e.g., MySQL) into its equivalent one for another system (e.g.,
ClickHouse), is of great practical importance but remains underexplored.
Existing SQL benchmarks are not well-suited for SQL-to-SQL evaluation, which
(1) focus on a limited set of database systems (often just SQLite) and (2)
cannot capture many system-specific SQL dialects (e.g., customized functions,
data types, and syntax rules). Thus, in this paper, we introduce PARROT, a
Practical And Realistic BenchmaRk for CrOss-System SQL Translation. PARROT
comprises 598 translation pairs from 38 open-source benchmarks and real-world
business services, specifically prepared to challenge system-specific SQL
understanding (e.g., LLMS achieve lower than 38.53% accuracy on average). We
also provide multiple benchmark variants, including PARROT-Diverse with 28,003
translations (for extensive syntax testing) and PARROT-Simple with 5,306
representative samples (for focused stress testing), covering 22
production-grade database systems. To promote future research, we release a
public leaderboard and source code at: https://code4db.github.io/parrot-bench/.