gold
SELECT tag FROM main.y ORDER BY mass ASC
- mass
- ascending, nulls first
sha256:e805cfe66db167e444562fbfcb99838ae2258d3d403e52e63213a6ec6597e3c9
R-ORD EQUAL ordering-over-numeric-text
questions
What are the tags, lightest first?
the hint the set supplies: the mass refers to main.y.mass
NOT_EQUAL states that these two statements disagree on this data under this rule. It does not state which of them is wrong.
SELECT tag FROM main.y ORDER BY mass ASC
sha256:e805cfe66db167e444562fbfcb99838ae2258d3d403e52e63213a6ec6597e3c9
SELECT t.tag FROM main.y AS t ORDER BY t.mass ASC
sha256:e805cfe66db167e444562fbfcb99838ae2258d3d403e52e63213a6ec6597e3c9
The marked tokens are where the two texts differ. Two statements that differ everywhere can return the same rows, and two that differ in one token can return other rows; the verdict above is read off the results.
from counterexample.json, 0 rows, up to 25 shown per side
| side | tagTEXT |
|---|---|
| no rows |
from counterexample.json, 0 rows, up to 25 shown per side
| side | tagTEXT |
|---|---|
| no rows |
set(second_rows) == set(gold_rows), REAL cells as Python float as sqlite3 returns them, so Python equality holds 1 == 1.0 == True as the benchmark's own scorer does
https://github.com/bird-bench/mini_dev/blob/main/evaluation/evaluation_ex.py
result_eq: equal row counts and equal column counts, each row unordered as a quick rejection, then the two equal as a list when the gold text holds ORDER BY and as a multiset otherwise, under some permutation of the columns; DISTINCT is not stripped and re-executed, and the cells are SQLite's as sqlite3 returns them
ruiqi-zhong/test-suite-sql-eval, exec_eval.py, result_eq, at commit 48cb78ec: https://github.com/ruiqi-zhong/test-suite-sql-eval/blob/48cb78ecf7f610620206283846c76751b18a1326/exec_eval.py
from counterexample.json, 3 rows
| tagTEXT |
|---|
| lead |
| zinc |
| iron |
from counterexample.json, 3 rows
| tagTEXT |
|---|
| lead |
| zinc |
| iron |
A smell is a mechanical reason to read this gold statement again. It is a heuristic: it does not state that the statement is wrong, and a maintainer decides.
this statement orders by a text column holding only numbers, and ordering it as a number gives a different answer, so the gold may be sorting 9.5 above 10
from smells.json, 3 rows
| lead |
| zinc |
| iron |
{
"heuristic": true,
"keys": [
{
"key": "mass",
"column": "main.y.mass",
"declared_type": "TEXT",
"not_applicable": null,
"census": {
"rows": 3,
"nulls": 0,
"empty_strings": 0,
"non_numeric": 0,
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
},
"every_value_is_numeric": true,
"cast_sql": "SELECT tag FROM main.y ORDER BY CAST(mass AS REAL) ASC",
"verdict": "not_equal",
"gold_result": {
"columns": [
{
"name": "tag",
"declared_type": "TEXT"
}
],
"row_count": 3,
"truncated": false,
"rows_shown": 3,
"rows": [
[
{
"type": "str",
"value": "lead"
}
],
[
{
"type": "str",
"value": "zinc"
}
],
[
{
"type": "str",
"value": "iron"
}
]
],
"result_hash": "sha256:e805cfe66db167e444562fbfcb99838ae2258d3d403e52e63213a6ec6597e3c9"
},
"cast_result": {
"columns": [
{
"name": "tag",
"declared_type": "TEXT"
}
],
"row_count": 3,
"truncated": false,
"rows_shown": 3,
"rows": [
[
{
"type": "str",
"value": "iron"
}
],
[
{
"type": "str",
"value": "lead"
}
],
[
{
"type": "str",
"value": "zinc"
}
]
],
"result_hash": "sha256:47d73ed070fd58c8c1afeb4797a592c958872b597b999e194dc7bfe8d0e53075"
}
}
]
}
this statement cuts its result at a LIMIT that does not decide which rows come back, so a different but equally correct statement can return other rows and score zero
the statement states no LIMIT
{
"heuristic": true,
"reason": "the statement states no LIMIT"
}
rerun over the same rows in another physical order this statement gives another answer, so its result depends on how the rows are stored and not only on the data
{
"heuristic": true,
"rule": "R-ORD",
"baseline_result_hash": "sha256:e805cfe66db167e444562fbfcb99838ae2258d3d403e52e63213a6ec6597e3c9",
"baseline_result": {
"columns": [
{
"name": "tag",
"declared_type": "TEXT"
}
],
"row_count": 3,
"truncated": false,
"rows_shown": 3,
"rows": [
[
{
"type": "str",
"value": "lead"
}
],
[
{
"type": "str",
"value": "zinc"
}
],
[
{
"type": "str",
"value": "iron"
}
]
],
"result_hash": "sha256:e805cfe66db167e444562fbfcb99838ae2258d3d403e52e63213a6ec6597e3c9"
},
"planner_statistics": {},
"shuffle": {
"seed": "1",
"row_limit": 300000,
"tables": [
"main.y"
],
"tables_not_shuffled": [
"main.y"
],
"tables_skipped_for_size": {},
"tables_not_reached_by_a_copy": {
"main.y": "the statement names this table's schema, and a name that states its schema is read from that schema whatever TEMP holds, so the rerun reads this table and not a copy of it"
}
},
"shuffled_copies": {
"run": true,
"verdict": "equal",
"differs": false,
"result_hash": "sha256:e805cfe66db167e444562fbfcb99838ae2258d3d403e52e63213a6ec6597e3c9",
"result": {
"columns": [
{
"name": "tag",
"declared_type": "TEXT"
}
],
"row_count": 3,
"truncated": false,
"rows_shown": 3,
"rows": [
[
{
"type": "str",
"value": "lead"
}
],
[
{
"type": "str",
"value": "zinc"
}
],
[
{
"type": "str",
"value": "iron"
}
]
],
"result_hash": "sha256:e805cfe66db167e444562fbfcb99838ae2258d3d403e52e63213a6ec6597e3c9"
}
},
"plan_variant": {
"run": false,
"reason": "the plan variant was not asked for"
}
}
SELECT tag FROM main.y ORDER BY mass ASC
result_hash sha256:e805cfe66db167e444562fbfcb99838ae2258d3d403e52e63213a6ec6597e3c9 recomputed from this JSON: match
record_hash sha256:731904489186726f997cd54057911c38140ef9e689b19876a478e53a9115ab02 recomputed from this JSON: match
from evidence-gold.json, 3 rows
| tagTEXT |
|---|
| lead |
| zinc |
| iron |
SELECT t.tag FROM main.y AS t ORDER BY t.mass ASC
result_hash sha256:e805cfe66db167e444562fbfcb99838ae2258d3d403e52e63213a6ec6597e3c9 recomputed from this JSON: match
record_hash sha256:f3297a20b4870e4cd7409117fbd7ded5963e869168d5dd9b821b9dd2d9e5137b recomputed from this JSON: match
from evidence-second.json, 3 rows
| tagTEXT |
|---|
| lead |
| zinc |
| iron |
re-run this statement read-only against SQLite 3.53.4 | file=/private/tmp/attestql-site-sandbox/demo/fixture.sqlite | size=69632 under the session settings and over the data this record's fixture digest names, and compare the two results under R-ORD
re-run this statement read-only against SQLite 3.53.4 | file=/private/tmp/attestql-site-sandbox/demo/fixture.sqlite | size=69632 under the session settings and over the data this record's fixture digest names, and compare the two results under R-ORD