The ducklake_sort_expression table stores the individual sort key expressions for each sort configuration. Each row corresponds to one expression in a SET SORTED BY clause.
| Column name | Column type | |
|---|---|---|
sort_id |
BIGINT |
|
table_id |
BIGINT |
|
sort_key_index |
BIGINT |
|
expression |
VARCHAR |
|
dialect |
VARCHAR |
|
sort_direction |
VARCHAR |
|
null_order |
VARCHAR |
sort_idrefers to asort_idfrom theducklake_sort_infotable.table_idrefers to atable_idfrom theducklake_tabletable.sort_key_indexdefines the position of this expression within the sort key using 0-based indexing. For example, inSET SORTED BY (a ASC, b DESC, c ASC)thesort_key_indexofbis1.expressionis the sort expression as a string. Column names and SQL expressions such aslower(name)are supported.dialectidentifies the SQL dialect used to interpretexpression. Currently alwaysduckdb.sort_directionis eitherASCorDESC.null_orderis eitherNULLS_FIRSTorNULLS_LAST.
© 2026 DuckDB Foundation, Amsterdam NL