You need to agree to share your contact information to access this dataset

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this dataset content.

Dataset Card for beaver-query

Homepage and leaderboard | Github repository | Paper

Beaver is a holistic framework for evaluating performance on complex, private‑enterprise text‑to‑SQL tasks. This repository includes questions and corresponding annotations. We reserve a portion of the full question set as a private, hidden test set. Each sample contains:

  • id: ID of the question
  • category: one of real, complex query, domain-specific query, domain-specific complex query.
    • real indicates the query originates from actual query logs. All other categories refer to queries synthesized from templates derived from real queries.
    • complex query: queries with high structural complexity (e.g., many joins, nesting) but no domain-specific knowledge
    • domain-specific query: queries with low structural complexity but requiring domain-specific knowledge
    • domain-specific complex query: queries with both high complexity and domain knowledge
  • detailed_category: one of real, base, cte, nested, cte-nested, nested-cte. A base query is not treated as a complex query, while a cte, nested, cte-nested, nested-cte query is considered a complex query.
    • real indicates the query originates from actual query logs. All other categories refer to queries synthesized from templates derived from real queries.
    • base indicates queries synthesized from base templates
    • cte indicates queries synthesized from Common-Table-Expression (CTE) templates
    • nested indicates queries synthesized from nesting templates
    • cte-nested indicates queries synthesized from nesting templates, followed by CTE templates
    • nested-cte indicates queries synthesized from CTE templates, followed by nesting templates
  • contains_domain_knowledge: whether the question includes domain knowledge
  • db: the ID of the referenced database
  • question: the natural language question user query
  • sql: the SQL statement whose execution answers the question
  • tables: the tables used in the SQL statement
  • join_keys: the join keys used in the SQL statement
  • column_mapping: mappings from phrases in the question to specific table columns
  • domain_knowledge: domain‑specific formatting rules or predicate logic
  • sub_questions: a decomposition of the question into multiple sub-steps
  • sub_sqls: the SQL statements corresponding to each sub‑step

Getting started

from datasets import load_dataset
import json

domain = 'dw'
data = load_dataset('beaverbench/beaver-query')
json_fields = ['tables', 'join_keys', 'column_mapping', 'domain_knowledge', 'sub_questions', 'sub_sqls']
for sample in data[domain]:
    sample = {k: (json.loads(v) if k in json_fields else v)  for k, v in sample.items()}
    # print(json.dumps(sample, indent=2))

Citation

@article{chen2024beaver,
  title={BEAVER: an enterprise benchmark for text-to-sql},
  author={Chen, Peter Baile and Yang, Devin and Li, Weiyue and Wenz, Fabian and Zhang, Yi and Tatbul, Nesime and Cafarella, Michael and Demiralp, {\c{C}}a{\u{g}}atay and Stonebraker, Michael},
  journal={arXiv preprint arXiv:2409.02038},
  year={2024}
}
Downloads last month
61

Collection including beaverbench/beaver-query

Paper for beaverbench/beaver-query