UniQL is a human-verified executable benchmark for cross-dialect text-to-SQL evaluation. UniQL extends the BIRD development split from SQLite to a controlled multi-dialect setting: the same 1,534 natural-language intents are aligned with executable SQL annotations across 16 SQL dialects, yielding 24,544 dialect-specific queries.
The artifact contains the minimum code and data needed to inspect the benchmark, run open-weight model inference, evaluate generated SQL under dialect-specific execution protocols, and reproduce the core construction pipeline components used for database migration and SQL translation.
Most text-to-SQL benchmarks evaluate models on a single SQL dialect, usually SQLite. In practice, SQL engines differ in syntax, built-in functions, type systems, ordering beha 8000 vior, duplicate semantics, implicit casts, and execution semantics. A query that is correct in SQLite may fail or produce different results in PostgreSQL, Hive, Trino, Druid, Teradata, or other engines.
UniQL is designed to isolate this cross-dialect generalization problem. It keeps the natural-language questions, schemas, and database contents aligned across dialects, so model performance differences reflect dialect transfer rather than unrelated task or schema changes.
Supported dialects:
SQLite, ClickHouse, Doris, Drill, Druid, DuckDB, Hive, MySQL, Oracle, PostgreSQL, Presto, Spark, StarRocks, Teradata, Trino, and T-SQL.
The paper's full per-dialect stratified results include all 13 models, subset sizes, and correct/total counts for the BIRD-difficulty and construction-stage analyses.
UniQL-DialectBench/
docs/ # GitHub Pages leaderboard website
data/
queries/ # SQLite source queries and constructed target-dialect task files
schemas/ # Dialect-specific schema descriptions
subsets/
clean_256/ # Clean 256-question evaluation subset
inference/
infer_open_source.py # vLLM-based inference for open-weight models
prompts/ # Text-to-SQL prompt template
sft/ # Intent-disjoint LoRA training and transfer experiment
evaluation/
evaluate.py # Main executable evaluation entry point
*_eval.py # Dialect-specific evaluators
migration/
clickhouse/
doris/
drill/
druid/
duckdb/
hive/
mysql/
oracle/
postgresql/
presto/
spark/
starrocks/
t_sql/
teradata/
trino/
source_bird/ # Source BIRD metadata used by migration scripts
construction/
main.py # Hybrid SQL translation pipeline
translator.py
validator.py
rule_optimizer.py
db_manager.py
prompts/
rules/
Each file under data/queries/ is a list of examples for one SQL dialect. The important fields are:
| Field | Description |
|---|---|
question_id |
Example identifier inherited from the aligned BIRD split. |
db_id |
Database identifier. |
question |
Natural-language question. |
evidence |
Optional evidence/hint text from the source data. |
difficulty |
Original BIRD difficulty label: simple, moderate, or challenging. |
SQL-* |
Dialect-specific reference SQL field. The exact suffix follows the dialect naming convention used by the construction scripts. |
annotation_source |
Construction stage for target-dialect SQL annotations. This field is intentionally absent from sqlite.json, which is the source dialect. |
For constructed target dialects, annotation_source can take:
| Value | Meaning |
|---|---|
glot |
Accepted from the tool-based SQLGlot translation stage. |
LLM-0shot |
Produced by direct LLM translation. |
LLM-retry |
Produced after bounded self-reflection with execution feedback. |
LLM-rule |
Produced after iterative rule evolution/refinement. |
human |
Human validated or human rewritten. |
UniQL currently provides two leaderboard tracks:
| Track | Files | Description |
|---|---|---|
UniQL-1534 |
data/queries/*.json |
The full aligned benchmark over 1,534 BIRD development questions. |
UniQL-Clean-256 |
data/subsets/clean_256/queries/*.json |
A supplementary 256-question clean-annotation subset selected to mitigate known annotation noise in the original BIRD development data. |
data/subsets/clean_256/question_ids.txt lists the selected original BIRD question identifiers.
The leaderboard supports an overall view and separate rankings for each of the 16 dialects. Single-dialect submissions appear alongside the baseline models in the corresponding dialect table; overall ranking requires all 16 dialects. See leaderboard data and submission details.
Inference may retry SQL using target-database error messages. Gold SQL, gold results, and evaluator correctness feedback must not be used to generate or repair predictions. Submissions must report their inference setup and reference/evaluator versions.
Both UniQL-1534 and UniQL-Clean-256 use the SQLite databases from BIRD's official dev.zip, release dev_20240627. Clean-256 selects questions from the full development split and uses the same databases. The database files distributed with BIRD mini-dev can have different SHA-256 hashes and fail the Oracle loader's source check.
After extracting the archive, point the Oracle loader's --root to /path/to/dev_20240627/dev_databases. The loader checks each SQLite file against the published source hashes before connecting to Oracle, then verifies full target content after migration. A source mismatch reports the file path, expected and actual hashes, and the required archive.
Create a Python environment and install the packages required by the inference and evaluation scripts. Exact database drivers depend on which dialects you evaluate.
conda create -n uniql python=3.10
conda activate uniql
pip install -r requirements.txtFor open-weight model inference with vLLM, install a CUDA-compatible vLLM build following the official vLLM instructions for your system.
Example: run a Qwen model on Hive examples.
python inference/infer_open_source.py \
--model Qwen3-8B \
--pretrained_model_name_or_path /path/to/Qwen3-8B \
--input_file data/queries/hive.json \
--schema_dir data/schemas \
--dialect Hive \
--output_file results/Qwen3-8B \
--tensor_parallel_size 4 \
--temperature 0For a quick prompt-building check without loading a model:
python inference/infer_open_source.py \
--input_file data/queries/mysql.json \
--schema_dir data/schemas \
--dialect mysql \
--dry_runThe inference script preserves annotation_source in its prediction outputs so that stratified analysis by construction stage remains possible.
In our reference setup with 8 NVIDIA A100 40GB GPUs, inference with the largest open-weight model we used, Llama3-70B-Instruct, takes approximately 10 minutes for the 1,534 examples in one dialect split.
The main evaluator compares predicted SQL against the dialect-specific reference SQL by executing both queries and comparing their outputs under the UniQL protocol. The protocol is stricter than unordered set comparison: it preserves ordering when order is semantically required and treats duplicate multiplicities conservatively.
Example:
python evaluation/evaluate.py \
--predicted_sql_path results/Qwen3-8B/hive_pred_sql.json \
--dialect hive \
--model Qwen3-8B \
--output_dir evaluation_resultsDialect-specific evaluators live in evaluation/*_eval.py. They handle connection details, query execution, and result normalization for each database system.
The sft/ directory provides the Qwen3-8B LoRA experiment with a fixed intent-disjoint split: 1,227 training intents and 307 test intents (seed 42). It includes SQLite-only, Balanced-16, and Full-16 supervision, together with a matched base-model inference protocol. See the SFT README for data preparation, training, inference, and executable evaluation.
The November 2026 dev-reference audit updates all Oracle identifier bindings and 26 reviewed SQLite references while preserving the original UniQL question/evidence fields. Oracle passes native validation for all 1,534 queries; all other 14 target dialects pass validation on the 26 repaired questions. Correct existing translations and target SQL outside those 26 questions are preserved. Clean-256 uses the same references as each dialect's full file. Audited Oracle rows use annotation_source=dev-gold-audit-20261112; reviewed target corrections use dev-reference-repair-20261112, alongside the historical construction-stage labels.
Native adaptations of existing translations can retain their historical construction-stage label. The audit report records the final SQL hashes and corresponding native execution evidence separately.
For Oracle, migrate with the updated gold and schema together. The new loader creates ordinary PDB users and preserves quoted table/column names. See the migration and evaluation instructions; use --num_cpus 1 for Oracle Free.
The migration/ directory contains database-specific scripts and configuration files for loading the source BIRD databases into target systems. It covers ClickHouse, Doris, Drill, Druid, DuckDB, Hive, MySQL, Oracle, PostgreSQL, Presto, Spark, StarRocks, T-SQL, Teradata, and Trino, with Docker/environment files where those services were run locally.
The construction/ directory contains the hybrid SQL translation pipeline:
- tool-based translation,
- LLM-based translation,
- execution-based validation,
- self-reflection with feedback,
- iterative rule evolution,
- human validation for unresolved or ambiguous cases.
The construction pipeline uses prompt templates in construction/prompts/ and dialect rules in construction/rules/.
UniQL evaluation requires live database backends for executable accuracy. Some dialects need local Docker services, external database servers, or vendor-specific drivers. The repository includes code and configuration used by the project, but users should adapt connection parameters, credentials, ports, and filesystem paths to their own environments before running migration or evaluation.
UniQL is intended for research on text-to-SQL, executable semantic parsing, SQL dialect transfer, and benchmark analysis. The benchmark extends the BIRD development split by preserving the original natural-language questions, evidence, database contents, and SQLite references while adding aligned SQL annotations for additional SQL dialects.
Our use of upstream artifacts is limited to benchmark construction and research evaluation. The derived dialect annotations, schemas, migration scripts, and evaluation code are intended to remain compatible with the original research-oriented access conditions of the upstream data. In particular, derivatives of data obtained for research purposes should be used for research, reproducibility, and non-commercial academic evaluation unless the upstream licenses and access terms explicitly allow broader use.
Users should not treat UniQL as a source of production database content, personally actionable information, or commercial training data without independently verifying that such use is permitted by the upstream datasets and any applicable database, driver, or model licenses. If users redistribute modified versions of UniQL, they should preserve this intended-use notice and document any additional upstream artifacts they incorporate.
If you find UniQL useful, please cite our paper.
@misc{gao2026uniql,
title = {UniQL: Towards Dialect-Universal Benchmarking for Text-to-SQL},
author = {Jianling Gao and Chongyang Tao and Jiayuan Bai and Liu Yang and Xuanguang Pan and Jinrui Liu and Shihao Xing and Xiaohan Xu and Jie Liang and Shuai Ma},
year = {2026},
eprint = {2606.08018},
archivePrefix = {arXiv},
primaryClass = {cs.CL}
}The benchmark artifact contains both source code and benchmark data, which may be subject to different licensing considerations.
- Code in
inference/,evaluation/,migration/, andconstruction/is intended to be released under a permissive open-source license. - Benchmark examples, schema metadata, and dialect-specific SQL annotations in
data/are intended for research use and should be redistributed consistently with the license terms of the underlying BIRD dataset and any other upstream resources. - Users are responsible for checking the licenses of external database systems, drivers, model checkpoints, and upstream datasets before redistribution or commercial use.