Table¶
A Table defines the schema, storage layout, and column metadata for a
table in a package database.
In a package, each table is stored as an individual file under the top
level tables/ directory, typically
{package-root}/tables/{table-name}.yaml.
The type field controls how the table is stored and managed:
partitioned: time-based data distributed across RDB, IDB, and HDBsplayed: supplementary or reference data stored as a directory of column files and memory mapped across tiersbasic: supplementary or reference data stored as a single file and memory mapped across tierssplayed_mem: splayed data loaded into memory across tiers
At least one table in a database must be partitioned. For partitioned
tables, prtnCol is required and must point to a timestamp column.
Important table settings include:
blockSize, which controls when buffered data is written to disksortColsMem,sortColsOrd, andsortColsDisk, which define sort order across memory, ordinal, and disk tiersprimaryKeys, which define keyed tables and update semanticsisSharded, which indicates that the table is split across packagesdelCol, which enables delete semantics for keyed non-partitioned tables
Column definitions describe column names, data types, attributes,
foreign-key relationships, and schema evolution behavior such as
oldName and backfill.
Schema changes are applied through package updates. Common supported changes include adding, renaming, deleting, and reordering tables or columns, changing column attributes and data types, and enabling or disabling encryption. Changes to on-disk sort order are not supported.
Contexts¶
| Context | Relationship | Object Path | Package File Path |
|---|---|---|---|
Database.TableList.schemas |
Package -> Database -> TableList -> Table |
$.databases[*].tables.schemas[*] |
{package-root}/databases/{db-name}/ |
TableList.schemas |
Package -> TableList -> Table |
$.tables.schemas[*] |
{package-root}/tables/{table-name}.yaml |
Fields¶
| Field | Type | Required | Description | Constraints | Default |
|---|---|---|---|---|---|
columns |
array<Column> |
yes | A list of the columns in the table. The order of this list of columns is the order they will be organized as. | - | - |
type |
Type3 |
yes | The type of the table is how the table is managed on disk. For time based tables, use partitioned One of {splayed, splayed_mem, partitioned, basic}. Required | - | - |
blockSize |
integer | null |
no | This value indicates when data should be written to disk. After this many records are received, data is written to disk. Writing more frequently increases disk IO but will use less memory. If omitted, the default value is 12 million records. | - | null |
delCol |
string | null |
no | The name of the 'delete column'. This field can only be used for keyed non-partitioned tables. It must refer to a boolean-typed column of the table. Any rows with the delete column set to 1b are deleted, i.e. such rows will not show up in query results and not use storage either. Deleted keys can be re-introduced with new updates with the delete column set to 0b. | pattern: "^[a-zA-Z][a-zA-Z0-9_]*$" |
null |
description |
string | null |
no | A textual description for the table. This can be used to provide an overview of the data collected in the current table. | - | "KXI Assembly Schema" |
isSharded |
boolean | null |
no | Specifies if this table is split across multiple packages. When using this property, it must be consistent for all instances of this table in all packages. | - | null |
metadata |
ComponentMetadata | null |
no | - | - | null |
name |
string | null |
no | Table name | pattern: "^[a-zA-Z][a-zA-Z0-9_]*$" |
null |
oldName |
string | null |
no | The name of a previous version of this table. This field can be used when changing the name of a table within a schema | pattern: "^[a-zA-Z][a-zA-Z0-9_]*$" |
null |
primaryKeys |
array<PrimaryKey> | null |
no | Names of columns to use as primary keys for this table. Primary keys are used for indicating unique data within a table. When provided, the table is keyed by these columns and any updates that have matching keys will update records with matching keys. | - | null |
prtnCol |
string | null |
no | The name of the column within the table to use to partition the content. The column type it points to must be a timestamp. This value is required if the table type is set to partitioned | pattern: "^[a-zA-Z][a-zA-Z0-9_]*$" |
null |
sortColsDisk |
array<PrimaryKey> | null |
no | A list of columns to use for sorting columns in a normal disk tier. Settings this value will sort data as it is migrated into disk partitions. If you want data to also have the sorted attribute, set attrDisk to sorted. | - | null |
sortColsMem |
array<PrimaryKey> | null |
no | A list of columns to use for sorting columns in a memory tier. Setting this value will sort data as it arrives in memory. If you want data to also have the sorted attribute, set attrMem to sorted | - | null |
sortColsOrd |
array<PrimaryKey> | null |
no | A list of columns to use for sorting columns in an ordinal partitioned tier. Setting this value will sort data as it migrates into ordinal partitions. If you want data to also have the sorted attribute, set attrOrd to sorted | - | null |
uuid |
string | null |
no | - | format: "uuid" |
- |
Links To¶
columns:Columnmetadata:ComponentMetadataprimaryKeys:PrimaryKeysortColsDisk:PrimaryKeysortColsMem:PrimaryKeysortColsOrd:PrimaryKeytype:Type3
Used In¶
TableListviaschemas