ES version is available. Content is displayed in original English for accuracy.
Advertisement
Advertisement
⚡ Community Insights
Discussion Sentiment
50% Positive
Analyzed from 188 words in the discussion.
Trending Topics
#sql#query#answer#bird#benchmark#semantic#queries#written#join#before

Discussion (1 Comments)Read Original on HackerNews
The bug it targets: fan-out double-counting. Join orders to order_items and SUM(order_total), and every dollar is counted once per line item. The query runs fine, the dashboard renders, the number is silently wrong.
To test it, we ran it over the gold (expert-written) answer keys of the Spider and BIRD text-to-SQL benchmarks — 2,568 queries, using only the benchmarks' own PK/FK declarations as the rulebook. It raised 45 flags and zero spurious ones. For one BIRD query we executed the benchmark's own database and proved the official gold answer wrong by 8× (the fan-out factor). Filed upstream: https://github.com/bird-bench/mini_dev/issues/37
Three ways to use it: CLI (CI gate), MCP server (agents call check_sql before executing; rejections carry machine-actionable fix hints — in our benchmark, applying the hint verbatim fixed the query 10/10 times in one round), or as a Python library wrapping an existing text-to-SQL generator.
Rulebooks come from what you already have: dbt tests (unique / relationships), PK/FK declarations, or OSI semantic model YAML. Happy to answer anything about the method or the benchmark findings.