{
  "format": "attestql/audit/smells/2",
  "reading": "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.",
  "smells": [
    {
      "name": "ordering-over-numeric-text",
      "fired": false,
      "applicable": false,
      "evidence": {
        "heuristic": true,
        "means": "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",
        "reason": "no ORDER BY key resolves to a text column",
        "keys": [
          {
            "key": "t1.buildUpPlaySpeed",
            "column": "Team_Attributes.buildUpPlaySpeed",
            "declared_type": "INTEGER",
            "not_applicable": "the column is not declared as text"
          }
        ]
      },
      "counterexample_rows": []
    },
    {
      "name": "arbitrary-cut",
      "fired": false,
      "applicable": true,
      "evidence": {
        "heuristic": true,
        "means": "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",
        "cut": 4,
        "offset": 0,
        "distinct_kept": false,
        "unbounded_sql": "SELECT t1.buildUpPlaySpeed, t1.buildUpPlaySpeed AS attestql_ordering_key_0 FROM Team_Attributes AS t1 INNER JOIN Team AS t2 ON t1.team_api_id = t2.team_api_id ORDER BY t1.buildUpPlaySpeed ASC",
        "unbounded_rows": 10,
        "projected_columns": [
          "buildupplayspeed"
        ],
        "ordering_key_columns": [
          "attestql_ordering_key_0"
        ],
        "ordering_keys": [
          {
            "key": "t1.buildUpPlaySpeed",
            "direction": "asc",
            "nulls": "first",
            "nulls_first_in_effect": true,
            "returned_rows_null_in_this_key": 0,
            "fires": false
          }
        ],
        "case": null
      },
      "counterexample_rows": []
    },
    {
      "name": "not-a-function-of-the-data",
      "fired": false,
      "applicable": true,
      "evidence": {
        "heuristic": true,
        "means": "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",
        "rule": "R-ORD",
        "baseline_result_hash": "sha256:8d975647a753e3980b6c60f43d0c5be69ccc5e1d95812a126b413ff3f7c9034b",
        "baseline_result": {
          "columns": [
            {
              "name": "buildupplayspeed",
              "declared_type": "INTEGER"
            }
          ],
          "row_count": 4,
          "truncated": false,
          "rows_shown": 4,
          "rows": [
            [
              {
                "type": "int",
                "value": 20
              }
            ],
            [
              {
                "type": "int",
                "value": 23
              }
            ],
            [
              {
                "type": "int",
                "value": 31
              }
            ],
            [
              {
                "type": "int",
                "value": 44
              }
            ]
          ],
          "result_hash": "sha256:8d975647a753e3980b6c60f43d0c5be69ccc5e1d95812a126b413ff3f7c9034b"
        },
        "planner_statistics": {},
        "shuffle": {
          "seed": "1",
          "row_limit": 300000,
          "tables": [
            "Team_Attributes",
            "Team"
          ],
          "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": "equal",
          "differs": false,
          "result_hash": "sha256:8d975647a753e3980b6c60f43d0c5be69ccc5e1d95812a126b413ff3f7c9034b",
          "result": {
            "columns": [
              {
                "name": "buildupplayspeed",
                "declared_type": "INTEGER"
              }
            ],
            "row_count": 4,
            "truncated": false,
            "rows_shown": 4,
            "rows": [
              [
                {
                  "type": "int",
                  "value": 20
                }
              ],
              [
                {
                  "type": "int",
                  "value": 23
                }
              ],
              [
                {
                  "type": "int",
                  "value": 31
                }
              ],
              [
                {
                  "type": "int",
                  "value": 44
                }
              ]
            ],
            "result_hash": "sha256:8d975647a753e3980b6c60f43d0c5be69ccc5e1d95812a126b413ff3f7c9034b"
          }
        },
        "plan_variant": {
          "run": false,
          "reason": "the plan variant was not asked for"
        }
      },
      "counterexample_rows": []
    }
  ]
}
