plan_check

Every node's schema, cardinality class and cache key, or the scope, type, ordering and leakage refusals.

QueryDeterministic

Flags

Flag Value
Kind query: reads values
Rows one result, not a table
Deterministic yes
Order matters no
Decomposable no
Makes no value

Parameters

Parameter Type Required Notes
plan object yes A plan in the IR hint.plan/1.
inputs map of reference | object no Each table a read names: its reference, or its schema and content hash.
response_format "concise" | "detailed" no The byte budget: 64 KiB concise, 512 KiB detailed.

Example

Over the example tables orders; ${input:name} is an input's reference and ${verb} the value an earlier call made.

JSON
plan_check {
  "plan": {
    "version": "hint.plan/1",
    "nodes": [
      {
        "id": "r",
        "op": "read",
        "params": {
          "input": "t"
        }
      },
      {
        "id": "f",
        "op": "filter",
        "inputs": [
          "r"
        ],
        "params": {
          "predicate": {
            "fn": "gt",
            "args": [
              {
                "col": 2
              },
              {
                "lit": "100.00",
                "type": {
                  "kind": "decimal128",
                  "precision": 10,
                  "scale": 2
                }
              }
            ]
          }
        }
      }
    ],
    "outputs": {
      "big": "f"
    }
  },
  "inputs": {
    "t": "${input:orders}"
  }
}

Result

2 nodes check

JSON
{
  "planHash": "sha256:7336f86f6b438f23bf0e4aa6353773fa18670971bff577ec0901acc02c078ba0",
  "nodes": "…",
  "outputs": {
    "big": "f"
  }
}

Diagnostics

A refusal comes back as ok: false with coded diagnostics; every code, with its fix, is on the diagnostics page. A parameter that does not match the schema above is ARG_INVALID, with the parameter's path.