gold
SELECT name FROM scores ORDER BY score DESC LIMIT 1
- score
- descending
sha256:f56de6cca7885057277d932c18dde41bdd72a8c72537dfa5221b885956dc35d8
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:f56de6cca7885057277d932c18dde41bdd72a8c72537dfa5221b885956dc35d8
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:f56de6cca7885057277d932c18dde41bdd72a8c72537dfa5221b885956dc35d8",
"baseline_result": {
"columns": [
{
"name": "name",
"declared_type": "TEXT"
}
],
"row_count": 1,
"truncated": false,
"rows_shown": 1,
"rows": [
[
{
"type": "str",
"value": "ash"
}
]
],
"result_hash": "sha256:f56de6cca7885057277d932c18dde41bdd72a8c72537dfa5221b885956dc35d8"
},
"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:79ded4083fac54ef16e9fa13d6119a401b789326fdd793fa07c5d5d3b7c2ff13",
"result": {
"columns": [
{
"name": "name",
"declared_type": "TEXT"
}
],
"row_count": 1,
"truncated": false,
"rows_shown": 1,
"rows": [
[
{
"type": "str",
"value": "bram"
}
]
],
"result_hash": "sha256:79ded4083fac54ef16e9fa13d6119a401b789326fdd793fa07c5d5d3b7c2ff13"
}
},
"plan_variant": {
"run": false,
"reason": "the plan variant was not asked for"
}
}
this statement returns the same whole row more than once and never says DISTINCT, so a statement answering the same question once per row disagrees on multiplicity alone
{
"heuristic": true,
"rows": 1,
"distinct_rows": 1,
"repeated_rows": 0,
"largest_repeat": 1,
"result_bounded": false,
"distinct_stated": false,
"set_operation": false,
"not_applicable": "a result of fewer than two rows has nothing to repeat"
}
SELECT name FROM scores ORDER BY score DESC LIMIT 1
result_hash sha256:f56de6cca7885057277d932c18dde41bdd72a8c72537dfa5221b885956dc35d8 recomputed from this JSON: match
record_hash sha256:e26a1872a0e20ad164d64e9982462cb1f4e2b40e388e7540b129d929aee73266 recomputed from this JSON: match
from evidence-gold.json, 1 row
| nameTEXT |
|---|
| ash |
re-run this statement read-only against SQLite 3.53.1 | file=/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