Partitions can refer to one or more columns, possibly with transformations such as hashing or bucketing.
| Column name | Column type | |
|---|---|---|
partition_id |
BIGINT |
|
table_id |
BIGINT |
|
partition_key_index |
BIGINT |
|
column_id |
BIGINT |
|
transform |
VARCHAR |
partition_idrefers to apartition_idfrom theducklake_partition_infotable.table_idrefers to atable_idfrom theducklake_tabletable.partition_key_indexdefines where in the partition key the column is using 0-based indexing. For example, in a partitioning by (a,b,c) thepartition_key_indexofbwould be1.column_idrefers to acolumn_idfrom theducklake_columntable.transformdefines the type of a transform that is applied to the column value, e.g.,year.
The table of supported transforms is as follows.
| Transform | Source type(s) | Description | Result type |
|---|---|---|---|
identity |
Any | Source value, unmodified | Source type |
year |
date, timestamp, timestamptz, timestamp_s, timestamp_ms, timestamp_ns |
Extract a date or timestamp year, as years from 1970 | int64 |
month |
date, timestamp, timestamptz, timestamp_s, timestamp_ms, timestamp_ns |
Extract a date or timestamp month, as months from 1970-01-01 | int64 |
day |
date, timestamp, timestamptz, timestamp_s, timestamp_ms, timestamp_ns |
Extract a date or timestamp day, as days from 1970-01-01 | int64 |
hour |
timestamp, timestamptz, timestamp_s, timestamp_ms, timestamp_ns |
Extract a timestamp hour, as hours from 1970-01-01 00:00:00 | int64 |