table_read
Bytes in a format (csv, jsonl, ipc) and a schema override to a table.
Flags
| Flag | Value |
|---|---|
| Kind | construct: makes a value from values |
| Rows | changes the rows |
| Deterministic | yes |
| Order matters | no |
| Decomposable | no |
| Makes | a table value |
Parameters
| Parameter | Type | Required | Notes |
|---|---|---|---|
source |
reference | yes | A value's reference. |
format |
object | no | |
filter |
object | no | A predicate the read rows are filtered by; a hint.ipc/2 file's chunks that cannot match are not read when it cannot fail. |
response_format |
"concise" | "detailed" | no | The byte budget: 64 KiB concise, 512 KiB detailed. |
Example
Over the example tables customers; ${input:name} is an input's reference and ${verb} the value an earlier call made.
table_write {
"table": "${input:customers}",
"format": {
"kind": "csv"
},
"limit": 5
}
table_read {
"source": "${table_write}",
"format": {
"kind": "csv"
}
}Result
5 rows read
{
"ref": "sha256:25983da8dcd245393187356351b6b30259ae1d6f955f11f4c161aac96648b18d",
"kind": "table",
"rows": 5,
"schema": {
"fields": [
{
"name": "cid",
"type": {
"kind": "int64"
},
"nullable": true,
"metadata": {}
},
{
"name": "name",
"type": {
"kind": "utf8"
},
"nullable": true,
"metadata": {}
},
{
"name": "region",
"type": {
"kind": "utf8"
},
"nullable": true,
"metadata": {}
},
{
"name": "since",
"type": {
"kind": "date"
},
"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.