plan_run

A checked plan executed over resolved inputs; the refs of its named outputs.

ConstructDeterministic

Flags

Flag Value
Kind construct: makes a value from 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
inputs map of reference yes Each table a read names, by reference.
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
lang_compile {
  "source": "from t | filter status == \"paid\" | aggregate {revenue = sum(amount)}",
  "inputs": {
    "t": "${input:orders}"
  }
}

plan_run {
  "plan": "${lang_compile:data.plan}",
  "inputs": {
    "t": "${input:orders}"
  }
}

Result

1 outputs

JSON
{
  "outputs": {
    "result": {
      "ref": "sha256:54b91dc35a10d8f7c82bca13b2dfe4b3da73010a76964001c386d7036c35e2c6",
      "kind": "table",
      "rows": 1,
      "schema": {
        "fields": [
          {
            "name": "revenue",
            "type": {
              "kind": "decimal128",
              "precision": 38,
              "scale": 2
            },
            "nullable": true,
            "metadata": {}
          }
        ],
        "metadata": {}
      }
    }
  }
}

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.