Updated on 2026-11-06 GMT+08:00

Iceberg Liquid Clustering

Liquid Clustering is a data organization strategy for Iceberg tables. After a clustering column is specified, Liquid Clustering physically groups data files with similar clustering column values to improve data read efficiency during query. Iceberg organizes these grouped data files using cubes as the basic management unit.

Liquid Clustering serves as an alternative to partitioned tables. Instead of relying on fixed partition directories, Liquid Clustering automatically clusters data based on clustering columns during writes and incrementally maintains the data layout. It adapts dynamically as data distribution changes. When data in a table changes, it can locally optimize the data layout without requiring a full-table repartition.

Table 1 Comparison between partition tables and Liquid Clustering

Dimension

Partitioned Tables

Liquid Clustering

Clustering dimension

Partition keys are limited by cardinality, primarily one-dimensional.

A clustering key can contain 2 to 4 columns, allowing for a mix of high and low cardinality. There is no directory splitting or metadata expansion.

Layout evolution

Modifying a partition key requires rewriting historical data.

Modifying a clustering key affects only newly written data. Old cubes with mismatched clustering columns are retained by default and can be rewritten using rewrite-all only when necessary, eliminating the need for full table migration.

Multidimensional filtering and pruning

Pruning occurs only along partition fields.

File-level data skipping allows multiple clustering keys to be skipped at the same time, greatly reducing the scanning workload.

File size maintenance

Compaction is fully manually scheduled.

Incremental maintenance: determined based on cube health (partial cubes smaller than min-cube-size are merged, and those exceeding the target size are split). Only unhealthy cubes are rewritten, and rest are skipped.

Metadata and catalog

Partition directories expand as cardinality grows.

There are no physical partition directories. Cube mappings are converged into a single sidecar JSON file, and the liquid_cubes metadata table is provided to intuitively monitor the cube health status.

Sorting and O&M

Partition pruning and Z-order mechanisms are combined.

The built-in Hilbert curve sorting ensures data locality and is executed through the rewrite_data_files entry. It is mutually exclusive with the sort/zorder policy to avoid mixing multiple O&M logics.

Application Scenarios

  • Tables with high-cardinality columns that are frequently used in query filters.
  • Tables with severe data skew.
  • Tables with rapidly increasing data volumes that require continuous maintenance and optimization.

Notes and Constraints

  • The format version of the Iceberg table must be 2 or later.
  • Two to four clustering columns are required.
  • The Iceberg table must be non-partitioned because Liquid Clustering is an alternative to partitioned tables.
  • Duplicate clustering columns are not allowed.
  • Clustering columns cannot be deleted from the schema.
  • The binpack/sort/zorder policy and partial-progress mode are incompatible with Iceberg tables that have Liquid Clustering enabled.

Cube

A Cube is the basic management unit for organizing data in Liquid Clustering. It refers to a logical group of data files generated under the same set of clustering rules. Each Cube contains the following:

  • Cube ID: A universally unique identifier (UUID).
  • Data file list: All data files belonging to the Cube.
  • Clustering column ID: The clustering column used to generate the Cube, stored as a field ID.
  • Total data volume: Total size of all data files within the Cube, in bytes.
  • Associated snapshot: The Iceberg snapshot of the Cube.

Cube Health

As data is continuously written, files within a Cube may become scattered or no longer comply with the current clustering specification. To address this, Iceberg compares each Cube with the clustering specification that takes effect in the table and outputs the health status of the Cube. The health status reflects the clustering effectiveness of the data within the Cube. Background tasks use this status to determine whether to perform a re-clustering rewrite operation on the Cube.

Table 2 Cube health status

Health Status

Description

Whether to Be Rewritten

Healthy

The total size of the Cube is greater than or equal to the value of the min-cube-size-bytes configuration item, and the clustering columns of the Cube exactly match the current clustering specification of the table.

Rewriting is performed only when rewrite-all is set to true.

Partial

The total size of the Cube is smaller than the value of min-cube-size-bytes. The Cube is too small and needs to be merged and rewritten to improve read efficiency.

Rewriting is always performed.

column_mismatch

The clustering columns used for creating the Cube do not match the active clustering specification of the table.

Rewriting is performed only when rewrite-all is set to true.

Configuration Items

Liquid Clustering is configured through Iceberg table properties.

Table 3 Configuration items

Table Property

Description

Default Value

write.liquid-clustering.columns

List of clustering columns, which are separated by commas (,).

None

write.liquid-clustering.target-cube-size-bytes

Target size of each Cube, in bytes. Files are grouped into Cubes. The size of a single Cube is not recommended to exceed this value.

10 GB

write.liquid-clustering.min-cube-size-bytes

Minimum threshold of a Cube, in bytes. Cubes whose size is less than this value will be marked as Partial and trigger rewriting.

5 GB

Clustering Column Selection

When specifying clustering columns, prioritize the columns most frequently used in query filter conditions. Multiple clustering columns can be defined in any order. If two columns are highly correlated, only one of them can be designated as a clustering column.

The following data types are supported for clustering columns:

  • INTEGER
  • LONG
  • FLOAT
  • DOUBLE
  • DECIMAL
  • DATE
  • TIMESTAMP
  • STRING