NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

PolySQL: Scaling Text-to-SQL Evaluation Across SQL Dialects via Automated Backend Isomorphism

Yotam Perlitz, Elad Venezian, Corentin Royer, Francesco Fusco, Andrea GiovanniniarXiv 2026

TL;DR

PolySQL introduces a novel dual-execution framework that scales Text-to-SQL evaluation across multiple enterprise database dialects without relying on brittle query transpilation. By executing gold queries on the source database and model predictions on an automatically migrated target database, PolySQL achieves 100% query coverage and uncovers a significant 10.1% performance drop when models transition from SQLite to enterprise environments.

What Problem Does This Paper Address?

While Text-to-SQL systems have advanced rapidly, their evaluation remains heavily bottlenecked by a single database engine: SQLite. Most popular benchmarks are built entirely on SQLite, creating a massive evaluation gap between academic research and production environments that run on enterprise engines like PostgreSQL, Snowflake, or BigQuery.

Evaluating models across different SQL dialects is notoriously difficult. Dialects vary wildly in syntax, type systems, and functions. Existing cross-dialect evaluation methods either require prohibitively expensive manual query rewriting or rely on automated transpilation tools (like SQLGlot or LLMs) that frequently crash or introduce semantic errors on complex queries. Furthermore, the authors show that SQLite performance is an unreliable proxy for enterprise performance; model rankings shift drastically when tested on different backends.

Methods

To eliminate the need for error-prone query transpilation, PolySQL introduces a Dual-Execution Protocol combined with Automated Environment Isomorphism.

Figure 1: Dual Execution vs. Query Transpilation. (a) Single-dialect evaluation. The model maps an NL question q to SQL, the SQL is executed on the source DB to obtain ˆRsrc, that is compared against a gold query result Rsrc. (b) Transpilation for cross-dialect evaluation. The model generates an SQL query ˆytgt

Instead of translating the query, PolySQL translates the database itself. The framework operates in three main steps:

  1. Database Migration: Using an industrial-grade ELT framework (dlt), PolySQL automatically migrates the database schema and data from the source (e.g., SQLite) to the target dialect, handling type mapping and relaxing strict referential integrity constraints to accommodate "dirty" benchmark data.
  2. Dual Execution: The original, human-verified gold query is executed on the source database to get a reference result set ($R^{src}$). Simultaneously, the model's predicted target-dialect query is executed on the migrated target database ($R^{tgt}$).
  3. Normalized Comparison: To prevent false negatives caused by engine-specific formatting differences (like timestamp formats or numeric precision), PolySQL passes the results through a strict three-stage normalized comparator. This handles bag semantics alignment (sorting unordered rows), type homogenization, and floating-point precision tolerance ($\epsilon = 10^{-5}$).

Datasets

The authors constructed 15 multi-dialect evaluation environments by sampling 100 instances from three prominent Text-to-SQL benchmarks:

  • Spider: Evaluates cross-domain generalization.
  • BIRD: Focuses on database efficiency and complexity.
  • Archer: Tests complex arithmetic reasoning.

Each benchmark was migrated from its native SQLite implementation into five major enterprise dialects: PostgreSQL, MySQL, Snowflake, BigQuery, and ClickHouse.

Key Insights and Ideas

  • The "SQLite Premium" is Real: Models perform systematically better on SQLite than on any other dialect. Optimizing a model solely for a SQLite leaderboard does not guarantee success in production.
  • Ranking Instability: A model's rank on SQLite is a poor predictor of its rank on enterprise systems. For example, Llama-3.1-405B ranks 2nd on SQLite but plummets to 9th when evaluated on Snowflake.
Figure 3: Ranking Instability Across Dialects. The y-axis reports model rank averaged over three datasets, as measured by PolySQLon each SQL dialect (x-axis). Rankings on SQLite (leftmost) differ markedly from those on enterprise dialects, revealing substantial rank reordering and limiting the predictive value of SQLite- based leaderboards (detailed analysis in Table 2).
  • Logic Over Syntax: Surprisingly, when models fail due to a dialect shift, it is rarely because of invalid syntax. 61.2% of cross-dialect errors are logical failures (syntactically valid queries that return the wrong rows due to misunderstood data types or join conditions), while pure syntax errors account for only 7.7%. Dialect shifts degrade a model's semantic reasoning, not just its grammar.
  • Dialect Difficulty Hierarchy: Not all enterprise dialects are created equal. Through pairwise McNemar's tests, the authors established a clear difficulty hierarchy: PostgreSQL and MySQL represent an intermediate tier, while BigQuery and Snowflake are the most challenging environments for current LLMs.

Key Results

  • High Evaluation Fidelity: Validated against BIRD’s manually transpiled gold standard, PolySQL achieved the highest reliability ($\kappa = 0.72$, $\rho = 0.75$) of any automated method while maintaining 100% query coverage. In comparison, rule-based static transpilation tools crashed on 54%–59% of complex queries.
  • The Generalization Gap: Across 16 state-of-the-art models evaluated, there was a systematic 10.1% average accuracy drop when moving from SQLite to enterprise dialects.
  • Model Performance: Claude 3.5 Sonnet dominated across all dialects (achieving a 50.5% average accuracy), followed by GPT-OSS-120B (43.8%) and DeepSeek V2.5/V3 (43.1%).

Limitations and Future Work

  • Source-Bias: Because the evaluation datasets originate from SQLite-based benchmarks, they only test the intersection of capabilities. They do not evaluate features exclusive to enterprise engines, such as Snowflake's semi-structured VARIANT type or BigQuery's array structs. It measures dialect portability rather than native mastery.
  • Knowledge vs. Instruction Following: The zero-shot prompting setup cannot fully disentangle whether a model fails because it lacks parametric knowledge of the target dialect or because it failed to follow the dialect-specific instructions in the prompt.
  • Compute Overhead: Unlike text-matching or static analysis, PolySQL requires active database infrastructure for multiple enterprise engines, making it computationally heavier to run.

Summary updated

BibTeX
@misc{perlitz2026polysql,
  author = {Yotam Perlitz and Elad Venezian and Corentin Royer and Francesco Fusco and Andrea Giovannini},
  title = {{PolySQL: Scaling Text-to-SQL Evaluation Across SQL Dialects via Automated Backend Isomorphism}},
  year = {2026},
  eprint = {2605.07796},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.07796},
}
Figure