tables/<name>.yaml
One file for each table. The name of the file is the name of the table. See tables for the modes, the types and the encodings.
A table file.
| key | type | default | description |
|---|---|---|---|
columns | map of ColumnSpec | required | The columns, in order. |
event_time | string | A temporal column that orders rows in time; drives retention and time pruning. | |
mode | TableMode | append | |
name | string | required | The table's name. Must match the file name (tables/<name>.yaml). |
primary_key | list of string | The key of an upsert table. | |
renamed_from | string | The table's previous name, to make a rename keep its data. | |
retention | Duration | How long rows are kept, measured on event_time. |
ColumnSpec
One column.
| key | type | default | description |
|---|---|---|---|
encoding | Encoding | Overrides the default encoding for the column's type. | |
filled | Filled | Filled in by the server on every write, never sent: credential (a string column: the name of the credential that wrote the row) or received (a timestamp column: when the server received it). | |
nullable | boolean | Whether the column may hold NULL. Columns are required by default. | |
renamed_from | string | The column's previous name, to make a rename keep its data. Removed again once the rename is applied. | |
type | ColumnType | required |
TableMode
How rows arrive in a table (plan D6).
| value | description |
|---|---|
append | Rows are only ever added. The cheapest mode, and the default: facts. |
upsert | Rows are keyed by primary_key; a row with an existing key replaces the old one. Dimensions. |
Duration
A duration with a unit: ms, s, m, h or d (e.g. 200ms, 730d).
Type: string.
Encoding
How a column is stored.
| value | description |
|---|---|
dict | Dictionary-encoded: every distinct value gets a small integer code. Cheap to filter and group by. The default for string, bool and date. |
plain | Stored as values. The default for numbers and timestamps, and the right choice for high-cardinality ids nobody filters by. |
Filled
What the server fills a column with (plan §9.2).
| value | description |
|---|---|
credential | The name of the ingest credential the row was written with. |
received | When the server received the row. |
ColumnType
A column type: bool, int32, int64, float64, decimal(p,s), string, date, timestamp or timestamptz.
Type: string.