Slackbot
02/24/2026, 9:13 PMRocky
02/24/2026, 9:14 PMbucket(N, column)
* year(column), month(column), day(column), hour(column)
* truncate(L, column)
3. Sort Keys (v4.0 feature): Specifically in version 4.0 and later, StarRocks also supports the ORDER BY clause to specify sort keys for Iceberg tables, which helps optimize data layout within the files.
Example Syntax:
To create a partitioned Iceberg table, you must first switch to or use an Iceberg catalog:
sql
-- Create a table with standard partitioning
CREATE TABLE iceberg_catalog.db_name.sample_table (
id INT,
event_time DATETIME,
data VARCHAR(255)
)
PARTITION BY (event_time);
-- Create a table with hidden partitioning (e.g., by month and bucket)
CREATE TABLE iceberg_catalog.db_name.hidden_part_table (
user_id INT,
event_date DATE,
action VARCHAR(20)
)
PARTITION BY bucket(user_id, 16), month(event_date);
-- Version 4.0 feature: Adding sort keys
CREATE TABLE iceberg_catalog.db_name.sorted_table (
id INT,
category INT,
ts DATETIME
)
PARTITION BY day(ts)
ORDER BY (category ASC, id DESC);
Important Notes:
* Catalog Requirement: You must perform these operations within an Iceberg Catalog (using HMS, AWS Glue, etc.).
* Column Order: Partition columns must be defined after non-partition columns in the CREATE TABLE statement.
* Default Values: All non-partition columns must use NULL as the default value (e.g., DEFAULT "NULL"). Partition columns cannot use NULL as a default value.
* Data Types: Partition columns do not support FLOAT, DOUBLE, DECIMAL, or DATETIME directly (though you can use transforms like day() on date/time types).
References
• data_source/catalog/iceberg/iceberg_catalog.md
• data_source/feature-support-data-lake-analytics.md
• quick_start/iceberg.md
• data_source/catalog/iceberg/iceberg_timetravel.md
• release_notes/release-2.1.mdCliff Resnick
02/24/2026, 9:32 PMRocky
02/24/2026, 9:32 PMCliff Resnick
02/24/2026, 11:57 PMRocky
02/24/2026, 11:58 PM