[Paper Review] Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflows
Spider 2.0 introduces a real-world enterprise text-to-SQL benchmark with 632 complex workflows derived from industrial databases, featuring massive schemas (avg. 812 columns), diverse SQL dialects, and multi-step data engineering tasks. Despite advanced LLMs like o1-preview, only 21.3% of tasks were solved, highlighting a critical gap in real-world enterprise performance.
Real-world enterprise text-to-SQL workflows often involve complex cloud or local data across various database systems, multiple SQL queries in various dialects, and diverse operations from data transformation to analytics. We introduce Spider 2.0, an evaluation framework comprising 632 real-world text-to-SQL workflow problems derived from enterprise-level database use cases. The databases in Spider 2.0 are sourced from real data applications, often containing over 1,000 columns and stored in local or cloud database systems such as BigQuery and Snowflake. We show that solving problems in Spider 2.0 frequently requires understanding and searching through database metadata, dialect documentation, and even project-level codebases. This challenge calls for models to interact with complex SQL workflow environments, process extremely long contexts, perform intricate reasoning, and generate multiple SQL queries with diverse operations, often exceeding 100 lines, which goes far beyond traditional text-to-SQL challenges. Our evaluations indicate that based on o1-preview, our code agent framework successfully solves only 21.3% of the tasks, compared with 91.2% on Spider 1.0 and 73.0% on BIRD. Our results on Spider 2.0 show that while language models have demonstrated remarkable performance in code generation -- especially in prior text-to-SQL benchmarks -- they require significant improvement in order to achieve adequate performance for real-world enterprise usage. Progress on Spider 2.0 represents crucial steps towards developing intelligent, autonomous, code agents for real-world enterprise settings. Our code, baseline models, and data are available at https://spider2-sql.github.io
Motivation & Objective
- Address the growing gap between benchmark performance and real-world enterprise text-to-SQL demands.
- Create a realistic evaluation framework reflecting industrial data workflows involving large-scale databases, multiple dialects, and complex reasoning.
- Assess the ability of LLMs to navigate metadata, documentation, codebases, and execute multi-query workflows.
- Provide a scalable, production-grade benchmark to guide the development of autonomous code agents for enterprise data systems.
Proposed method
- Collect 632 real-world text-to-SQL tasks from enterprise applications (e.g., Salesforce, Google Analytics) with actual enterprise database schemas.
- Source databases from real systems including BigQuery, Snowflake, SQLite, and DuckDB, with average schema size of 812 columns.
- Incorporate diverse SQL dialects (e.g., Google, Snowflake SQL) through documentation, tutorials, and open-source projects.
- Design a structured environment with access to database metadata, project codebases (e.g., dbt), and external documentation.
- Implement a code agent framework with actions including SQL execution, file editing, bash commands, and table metadata retrieval.
- Define a rigorous evaluation protocol requiring correct output format (CSV or text), full workflow execution, and validation against YAML definitions.
Experimental results
Research questions
- RQ1To what extent can current LLMs generalize to real-world enterprise text-to-SQL workflows with complex, multi-step data engineering pipelines?
- RQ2How do LLMs perform when required to reason across large schemas, dialect-specific functions, and external documentation?
- RQ3What is the impact of long-context reasoning and multi-query generation (often >100 lines) on model performance in realistic enterprise settings?
- RQ4How well do LLMs handle project-level codebases (e.g., dbt) and validate outputs against schema definitions?
- RQ5What are the key failure modes in enterprise text-to-SQL workflows that are absent in traditional benchmarks?
Key findings
- Only 21.3% of tasks were successfully solved by the o1-preview model using the code agent framework, indicating a significant performance gap in real-world settings.
- This performance drops drastically compared to 91.2% on Spider 1.0 and 73.0% on BIRD, highlighting the increased complexity of enterprise workflows.
- The average ground-truth SQL query contains 144 tokens and includes advanced functions like ST_DISTANCE, reflecting high syntactic and semantic complexity.
- Successful solutions required extensive interaction with metadata, documentation, and codebases—beyond simple question-to-SQL mapping.
- Models frequently failed on output format validation, such as returning intermediate SQL instead of final CSV or text results.
- Even after executing queries, models often failed to verify results against schema definitions, especially in dbt-based projects.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.