gold
SELECT name FROM scores ORDER BY score DESC LIMIT 1
- score
- descending
sha256:d500dc5fa293a6c4835e6fc60205555fe47bb3f7a37834dbf188edeba5fc449f
R-ORD GOLD-ONLY arbitrary-cut not-a-function-of-the-data
questions
Who holds the highest score?
the hint the set supplies: the highest score refers to MAX(score)
This question was audited without a prediction beside it, so there is nothing to compare the gold with. The probes below read the gold alone.
SELECT name FROM scores ORDER BY score DESC LIMIT 1
sha256:d500dc5fa293a6c4835e6fc60205555fe47bb3f7a37834dbf188edeba5fc449f
from evidence-gold.json, 1 row
| nameTEXT |
|---|
| ash |
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
no ORDER BY key resolves to a text column
{
"heuristic": true,
"reason": "no ORDER BY key resolves to a text column",
"keys": [
{
"key": "score",
"column": "scores.score",
"declared_type": "INTEGER",
"not_applicable": "the column is not declared as text"
}
]
}
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
from smells.json, 3 rows
| ash | 99 |
| bram | 99 |
| cleo | 99 |
{
"heuristic": true,
"cut": 1,
"offset": 0,
"distinct_kept": false,
"unbounded_sql": "SELECT name, score AS attestql_ordering_key_0 FROM scores ORDER BY score DESC",
"unbounded_rows": 6,
"projected_columns": [
"name"
],
"ordering_key_columns": [
"attestql_ordering_key_0"
],
"ordering_keys": [
{
"key": "score",
"direction": "desc",
"nulls": "last",
"nulls_first_in_effect": false,
"returned_rows_null_in_this_key": 0,
"fires": false
}
],
"tied_at_the_cut": {
"positions": [
0,
1,
2
],
"tied_rows": 3,
"distinct_projected_answers": 3,
"rows": [
[
{
"type": "str",
"value": "ash"
}
],
[
{
"type": "str",
"value": "bram"
}
],
[
{
"type": "str",
"value": "cleo"
}
]
]
},
"case": "tie-at-the-cut"
}
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
from smells.json, 1 row
| bram |
{
"heuristic": true,
"rule": "R-ORD",
"baseline_result_hash": "sha256:d500dc5fa293a6c4835e6fc60205555fe47bb3f7a37834dbf188edeba5fc449f",
"baseline_result": {
"columns": [
{
"name": "name",
"declared_type": "TEXT"
}
],
"row_count": 1,
"truncated": false,
"rows_shown": 1,
"rows": [
[
{
"type": "str",
"value": "ash"
}
]
],
"result_hash": "sha256:d500dc5fa293a6c4835e6fc60205555fe47bb3f7a37834dbf188edeba5fc449f"
},
"planner_statistics": {},
"shuffle": {
"seed": "1",
"row_limit": 300000,
"tables": [
"scores"
],
"tables_not_shuffled": [],
"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": "not_equal",
"differs": true,
"result_hash": "sha256:267ca256126251d0810bdb5d42028edbe1d9d583007cbb3963058fe0b6e18323",
"result": {
"columns": [
{
"name": "name",
"declared_type": "TEXT"
}
],
"row_count": 1,
"truncated": false,
"rows_shown": 1,
"rows": [
[
{
"type": "str",
"value": "bram"
}
]
],
"result_hash": "sha256:267ca256126251d0810bdb5d42028edbe1d9d583007cbb3963058fe0b6e18323"
}
},
"plan_variant": {
"run": false,
"reason": "the plan variant was not asked for"
}
}
SELECT name FROM scores ORDER BY score DESC LIMIT 1
result_hash sha256:d500dc5fa293a6c4835e6fc60205555fe47bb3f7a37834dbf188edeba5fc449f recomputed from this JSON: match
record_hash sha256:844f744103463d37858643f4bed9b075b0fb9c6b75cce9595ae30cf39edec7c5 recomputed from this JSON: match
from evidence-gold.json, 1 row
| nameTEXT |
|---|
| ash |
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