table_project

Columns computed from expressions, with the derived schema.

ConstructDeterministic

Flags

Flag Value
Kind construct: makes a value from values
Rows keeps the rows
Deterministic yes
Order matters no
Decomposable yes
Makes a table value

Parameters

Parameter Type Required Notes
table reference yes A value's reference.
columns array of named no The output columns, each a name and an expression.
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
table_project {
  "table": "${input:orders}",
  "columns": [
    {
      "name": "status",
      "expr": {
        "col": 7
      }
    }
  ]
}

Result

240 rows

JSON
{
  "ref": "sha256:0780816eead0a447c72a1854caf994b389fcd2d79537b468568aa435699d4d99",
  "kind": "table",
  "rows": 240,
  "schema": {
    "fields": [
      {
        "name": "status",
        "type": {
          "kind": "utf8"
        },
        "nullable": true,
        "metadata": {}
      }
    ],
    "metadata": {}
  }
}

In the hint language

The same step as a plan, as the language prints it.

Hint
output out = from orders
select {status}

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.