This table describes the columns that are part of a table, including their types, default values, etc.
| Column name | Column type | |
|---|---|---|
column_id |
BIGINT |
|
begin_snapshot |
BIGINT |
|
end_snapshot |
BIGINT |
|
table_id |
BIGINT |
|
column_order |
BIGINT |
|
column_name |
VARCHAR |
|
column_type |
VARCHAR |
|
initial_default |
VARCHAR |
|
default_value |
VARCHAR |
|
nulls_allowed |
BOOLEAN |
|
parent_column |
BIGINT |
column_idis the numeric identifier of the column. If the Parquet file includes a field identifier, it corresponds to the file'sfield_id. This identifier should remain consistent throughout all versions of the column, until it's dropped. Thecolumn_idmust be unique per table.begin_snapshotrefers to asnapshot_idfrom theducklake_snapshottable. This version of the column exists starting with this snapshot id.end_snapshotrefers to asnapshot_idfrom theducklake_snapshottable. This version of the column exists up to but not including this snapshot id. Ifend_snapshotisNULL, this version of the column is currently valid.table_idrefers to atable_idfrom theducklake_tabletable.column_orderis a number that defines the position of the column in the list of columns. It needs to be unique within a snapshot but does not have to be contiguous (gaps are ok).column_nameis the name of this version of the column, e.g.,my_column.column_typeis the type of this version of the column as defined in the list of data types.initial_defaultis the initial default value as the column is being created, e.g., inALTER TABLE, encoded as a string. Can beNULL.default_valueis the operational default value as data is being inserted and updated, e.g., inINSERT, encoded as a string. Can beNULL.nulls_alloweddefines whetherNULLvalues are allowed in this version of the column. Note that default values have to be set if this is set tofalse.parent_columnis thecolumn_idof the parent column. This isNULLfor top-level and non-nested columns. For example, forSTRUCTtypes, this would refer to the "parent" struct column.
Every
ALTERof the column creates a new version of the column, which will use the samecolumn_id.