Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflows

Fangyu Lei, Fangyu Lei, Jixuan Chen, Yuxiao Ye, Ruisheng Cao, Dongchan Shin, Hongjin Su, Zhaoqing Suo, Hongcheng Gao, Hongcheng Gao, Pengcheng Yin, Victor Zhong, Caiming Xiong, Ruoxi Sun, Qian Liu, Sida Wang, Tao Yu

arXiv:2411.07763 · 2026-07-27 공개 · arXiv · PDF

long-context code-generation workflow-evaluation code-agents text-to-sql database-metadata enterprise-databases bigquery

Abstract

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

한국어 요약

한 줄 요약

Spider 2.0은 632개의 실제 기업 데이터베이스 워크플로우를 기반으로, 기존 텍스트-투-SQL 벤치마크보다 훨씬 복잡한 SQL 생성과 다이얼렉트 이해를 요구하는 새로운 평가 프레임워크이다.

핵심 기여도

핵심 아이디어

Spider 2.0은 기존 텍스트-투-SQL 벤치마크가 간단한 SQL과 소규모 스키마에만 집중한 반면, 실제 기업 환경에서는 다양한 데이터베이스 시스템, 복잡한 다이얼렉트, 대규모 스키마, 프로젝트 레벨 코드베이스와의 상호작용이 필요하다는 점을 반영한 새로운 평가 프레임워크이다.
이를 위해 실제 산업용 데이터베이스(예: Google Analytics, Salesforce)를 기반으로 구성되며, SQL 생성 과정에서 외부 문서, 메타데이터, 코드베이스를 참조해야 하는 다단계 작업이 요구된다.
예를 들어, SQL 쿼리는 단순히 질문을 해석하는 것을 넘어, 데이터 전처리, 변환, 분석까지 포함하며, 이는 기존 텍스트-투-SQL 작업과는 차원이 다르다.

기술적 접근법

주요 결과

의의 및 한계

Spider 2.0은 기존 텍스트-투-SQL 평가가 실제 기업 환경을 반영하지 못한 점을 보완하며, 복잡한 SQL 생성, 다이얼렉트 이해, 코드베이스 탐색 등 실제 엔터프라이즈 워크플로우를 시뮬레이션하는 데 중요한 역할을 한다.
하지만, 기존 LLM 기반 코드 에이전트는 외부 문서 해석, 중첩 스키마 이해, 다중 SQL 쿼리 생성 등에서 여전히 한계가 있으며, 이는 기업 수준 SQL 전문가 역할 수행에 필요한 핵심 능력이다.
또한, 실험에서 제공된 오라클 함수 문서가 성능 개선에 거의 기여하지 못한 점은, LLM이 단순히 함수를 선택하는 것 이상의 복잡한 추론 능력이 필요하다는 것을 시사한다.

실용적 활용

Spider 2.0은 데이터 엔지니어링, 비즈니스 인텔리전스, 데이터 분석 등 기업 내 다양한 SQL 기반 워크플로우 자동화에 적용 가능하다.
특히, 대규모 데이터베이스와 복잡한 SQL 다이얼렉트를 다루는 환경에서 LLM 기반 코드 에이전트의 성능 향상을 위한 연구와 개선 방향을 제시할 수 있다.
이를 통해 기업은 반복적인 SQL 작업을 자동화하고, 데이터 전문가의 부담을 줄이는 데 기여할 수 있다.