Help Center/ AI DataLake/ devg/ Iceberg Development Guide/ Iceberg on Spark/ Liquid Clustering Usage
Updated on 2026-11-06 GMT+08:00
Liquid Clustering Usage
Liquid Clustering Configuration
Liquid Clustering is configured using Iceberg table properties.
CREATE TABLE events (
event_id BIGINT,
user_id BIGINT,
event_type STRING,
event_time TIMESTAMP,
payload STRING
)
USING iceberg
TBLPROPERTIES (
'format-version' = '2',
'write.liquid-clustering.columns' = 'user_id,event_time'
); Specifying Custom Cube Size
CREATE TABLE logs (
log_id BIGINT,
service_name STRING,
log_level STRING,
message STRING,
timestamp TIMESTAMP
)
USING iceberg
TBLPROPERTIES (
'format-version' = '2',
'write.liquid-clustering.columns' = 'service_name,timestamp',
'write.liquid-clustering.target-cube-size-bytes' = '21474836480',
'write.liquid-clustering.min-cube-size-bytes' = '5368709120'
); Note: Set target-cube-size-bytes to 20 GB (21,474,836,480 bytes) and min-cube-size-bytes to 5 GB (5,368,709,120 bytes).
Modifying Liquid Clustering Configuration
-- Modify the clustering columns (only adding is supported; deleting existing clustering columns is not supported).
ALTER TABLE events SET TBLPROPERTIES ('write.liquid-clustering.columns' = 'user_id,event_time,event_type');
-- Adjust the target Cube size.
ALTER TABLE events SET TBLPROPERTIES ('write.liquid-clustering.target-cube-size-bytes' = '32212254720');
-- Adjust the minimum Cube threshold.
ALTER TABLE events SET TBLPROPERTIES ('write.liquid-clustering.min-cube-size-bytes' = '10737418240'); Triggering Cube Rewriting
-- Rewrite all Cubes marked as Partial.
CALL spark_catalog.system.rewrite_data_files(
table => 'db.events',
options => map('rewrite-all', 'false')
);
-- Rewrite all Cubes (including healthy Cubes).
CALL spark_catalog.system.rewrite_data_files(
table => 'db.events',
options => map('rewrite-all', 'true')
); Parent topic: Iceberg on Spark
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot