Dataset Viewer
Duplicate
The dataset viewer is not available for this split.
Cannot load the dataset split (in streaming mode) to extract the first rows.
Error code:   StreamingRowsError
Exception:    TypeError
Message:      Couldn't cast array of type
struct<aggregate: string, aggregate_case: string, aggregate_having: string, outer_join_aggregate: string, join: string, join_aggregate: string, join_multiplicity: string, distinct_join: string, self_join: string, anti_join_null: string, anti_join_exists: string, semi_join_exists: string, in_subquery: string, not_in_subquery: string, correlated_scalar: string, scalar_subquery: string, correlated_max: string, derived_table: string, cte: string, recursive_cte: string, outer_join_predicate: string, semi_anti_join: string, anti_join_subquery: string, range_filter: string, pattern_filter: string, null_aware_filter: string, or_filter: string, boundary_filter: string, group_by_expression: string, order_limit: string, top_n_ties: string, distinct_filter: string, union_all: string, union_distinct: string, count_star_vs_column: string, window_row_number: string, window_rank: string, window_running: string, date_function: string>
to
{'aggregate': Value('string'), 'aggregate_case': Value('string'), 'aggregate_having': Value('string'), 'outer_join_aggregate': Value('string'), 'join': Value('string'), 'join_aggregate': Value('string'), 'join_multiplicity': Value('string'), 'distinct_join': Value('string'), 'self_join': Value('string'), 'anti_join_null': Value('string'), 'anti_join_exists': Value('string'), 'semi_join_exists': Value('string'), 'in_subquery': Value('string'), 'not_in_subquery': Value('string'), 'correlated_scalar': Value('string'), 'scalar_subquery': Value('string'), 'correlated_max': Value('string'), 'derived_table': Value('string'), 'cte': Value('string'), 'recursive_cte': Value('string'), 'outer_join_predicate': Value('string'), 'semi_anti_join': Value('string'), 'anti_join_subquery': Value('string'), 'range_filter': Value('string'), 'pattern_filter': Value('string'), 'null_aware_filter': Value('string'), 'or_filter': Value('string'), 'boundary_filter': Value('string'), 'group_by_expression': Value('string'), 'order_limit': Value('string'), 'top_n_ties': Value('string'), 'distinct_filter': Value('string'), 'union_all': Value('string'), 'union_distinct': Value('string'), 'count_star_vs_column': Value('string'), 'window_row_number': Value('string'), 'window_rank': Value('string'), 'window_running': Value('string')}
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/utils.py", line 151, in get_rows_or_raise
                  return get_rows(
                      dataset=dataset,
                  ...<4 lines>...
                      column_names=column_names,
                  )
                File "/src/libs/libcommon/src/libcommon/utils.py", line 274, in decorator
                  return func(*args, **kwargs)
                File "/src/services/worker/src/worker/utils.py", line 131, in get_rows
                  rows_plus_one = list(itertools.islice(safe_iter(ds, dataset=dataset), rows_max_number + 1))
                File "/src/services/worker/src/worker/utils.py", line 574, in safe_iter
                  yield from ds.decode(False) if ds.features else ds
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 3074, in __iter__
                  for key, example in ex_iterable:
                                      ^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2578, in __iter__
                  for key, pa_table in self._iter_arrow():
                                       ~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2603, in _iter_arrow
                  for key, pa_table in self.ex_iterable._iter_arrow():
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 577, in _iter_arrow
                  for key, pa_table in iterator:
                                       ^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 459, in _iter_arrow
                  for key, pa_table in self.generate_tables_fn(**gen_kwags):
                                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 373, in _generate_tables
                  self._cast_table(pa_table, json_field_paths=json_field_paths),
                  ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
                  pa_table = table_cast(pa_table, self.info.features.arrow_schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2394, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2328, in cast_table_to_schema
                  cast_array_to_feature(
                  ~~~~~~~~~~~~~~~~~~~~~^
                      table[name] if name in table_column_names else pa.array([None] * len(table), type=schema.field(name).type),
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      feature,
                      ^^^^^^^^
                  )
                  ^
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1870, in wrapper
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                                           ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2170, in cast_array_to_feature
                  raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
              TypeError: Couldn't cast array of type
              struct<aggregate: string, aggregate_case: string, aggregate_having: string, outer_join_aggregate: string, join: string, join_aggregate: string, join_multiplicity: string, distinct_join: string, self_join: string, anti_join_null: string, anti_join_exists: string, semi_join_exists: string, in_subquery: string, not_in_subquery: string, correlated_scalar: string, scalar_subquery: string, correlated_max: string, derived_table: string, cte: string, recursive_cte: string, outer_join_predicate: string, semi_anti_join: string, anti_join_subquery: string, range_filter: string, pattern_filter: string, null_aware_filter: string, or_filter: string, boundary_filter: string, group_by_expression: string, order_limit: string, top_n_ties: string, distinct_filter: string, union_all: string, union_distinct: string, count_star_vs_column: string, window_row_number: string, window_rank: string, window_running: string, date_function: string>
              to
              {'aggregate': Value('string'), 'aggregate_case': Value('string'), 'aggregate_having': Value('string'), 'outer_join_aggregate': Value('string'), 'join': Value('string'), 'join_aggregate': Value('string'), 'join_multiplicity': Value('string'), 'distinct_join': Value('string'), 'self_join': Value('string'), 'anti_join_null': Value('string'), 'anti_join_exists': Value('string'), 'semi_join_exists': Value('string'), 'in_subquery': Value('string'), 'not_in_subquery': Value('string'), 'correlated_scalar': Value('string'), 'scalar_subquery': Value('string'), 'correlated_max': Value('string'), 'derived_table': Value('string'), 'cte': Value('string'), 'recursive_cte': Value('string'), 'outer_join_predicate': Value('string'), 'semi_anti_join': Value('string'), 'anti_join_subquery': Value('string'), 'range_filter': Value('string'), 'pattern_filter': Value('string'), 'null_aware_filter': Value('string'), 'or_filter': Value('string'), 'boundary_filter': Value('string'), 'group_by_expression': Value('string'), 'order_limit': Value('string'), 'top_n_ties': Value('string'), 'distinct_filter': Value('string'), 'union_all': Value('string'), 'union_distinct': Value('string'), 'count_star_vs_column': Value('string'), 'window_row_number': Value('string'), 'window_rank': Value('string'), 'window_running': Value('string')}

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

SREB: SQL Rewrite Evidence Benchmark

A dataset of executable evidence for SQL query rewrites proposed by language models.

Most SQL benchmarks ask "write a query for this question". Most rewrite papers report a success rate. SREB publishes something different: for every rewrite, the database state on which the result changes and the rows that prove it.

reference [1,1,1,1]    candidate [1,1,1]    ->  multiplicities lost

Why it is different

Existing work What it gives Missing
Spider, BIRD text-to-SQL evaluation no rewrite validation
GenRewrite, R-Bot, LLM-R2 success rates on benchmarks no per-rewrite witness
Cosette, VeriEQL formal proofs for supported SQL coverage, and no run-level evidence

SREB keeps the evidence, not the score. Every record is reproducible: database version, model digest, sampling parameters, state profile, and the rows that differ.

What is inside

Config Content
corpus query families: schema DDL, constraints, reference SQL, breaking profile
states frozen state banks generated under the real schema constraints
runs model responses with digest, quantization and sampling parameters
evidence outcome per (family, model): status, refuting states, row witness

Outcome values: refuted, preserved, no_rewrite, unsupported, error.

preserved means no refuting state was found on the finite bank. It is not a proof of equivalence, and the dataset never claims otherwise.

Reproduce

git clone https://github.com/ykvlev/sql-rewrite-evidence-bench
pip install -r scripts/requirements.txt
python scripts/check_corpus.py --repo-root .        # hashes, pins, integrity
python scripts/recompute_tables.py --repo-root .    # rebuild summary tables

Every published number is recomputable from data/ without rerunning a model.

Scale (v0.3.0)

  • query families: 204 across three schemas (library, online shop, university)
  • frozen states: 5 712 (28 profiles per family)
  • model runs: 1 224 (6 models × 204 evaluated families)
  • evidence: 204 families, evaluated on MySQL 8.4.11
  • total checks: 34 272 (model × family × state)
  • models: Qwen2.5-Coder-7B, Qwen2.5-7B, Qwen2.5-3B, Phi-3.5-mini-3.8B, DeepSeek-Coder-V2, Llama-3.2-3B

Cross-DBMS check: the schemas and the 136 library/shop reference queries execute on PostgreSQL 16.15 without modification; on the 12 seed families the reference results and candidate classifications match MySQL exactly (0 divergences over 336 state pairs). The university schema has not been ported yet.

Limitations

  • Synthetic schemas: coverage of real workloads is partial.
  • A finite state bank cannot prove equivalence.
  • Witnesses are not minimised: the recorded state is the first one that refuted the candidate, not the smallest possible.
  • Model behaviour changes across engine versions; the engine version is part of the record. The six models span Ollama 0.40.4–0.40.6.
  • Small models can return invalid SQL: 23 answers are unsupported and 33 are error of 1 224 (recorded, not retried).

Licence

Data and documentation: CC BY 4.0. Code: MIT.

Citation

@dataset{yakovlev_sreb,
  title  = {SREB: SQL Rewrite Evidence Benchmark},
  author = {Yakovlev, Artem},
  year   = {2026},
  note   = {ORCID 0009-0006-8617-7895},
  url    = {https://github.com/ykvlev/sql-rewrite-evidence-bench}
}
Downloads last month
45