Skip to main content
When RisingWave streams data into Iceberg, it generates many small data files and creates frequent snapshots. Over time, this can degrade query performance and increase storage costs. To maintain healthy tables, RisingWave provides both automatic and manual maintenance features for compaction and snapshot expiration.
  • Compaction: Merges small data files and delete files into larger, optimized files to improve read performance.
  • Snapshot Expiration: Removes old, unneeded snapshots and their associated data files to reclaim storage space.

Automatic maintenance

Version notes
  • RisingWave introduced Iceberg automatic maintenance (default) in v2.5.0 and added compaction.type with the small-files and files-with-delete compaction types in v2.7.0.
  • compaction.write_parquet_compression and compaction.write_parquet_max_row_group_rows were added in v2.9.0. The compaction.target_file_size_mb parameter now also controls the output file size for sink writes (previously only applied to compaction).
  • Parameters prefixed with compaction are currently in technical preview stage and may change in future releases.
You can enable automatic maintenance to run periodically in the background for your Iceberg sinks and internal tables.
Dedicated compactor requiredAutomatic Iceberg maintenance requires a dedicated compactor node. Before enabling enable_compaction = true, ensure your cluster has at least one compactor node deployed. For deployment instructions and sizing guidelines, see Deploy a dedicated Iceberg compactor.

Compaction types

RisingWave supports three compaction types for Iceberg tables. You can specify the type using the compaction.type parameter.
The small-files and files-with-delete compaction types are only supported in Merge-on-Read mode. Copy-on-Write mode only supports the full compaction type.

Parameters

Configure automatic maintenance by specifying the following parameters in the WITH clause of a CREATE SINK or CREATE TABLE ... ENGINE = iceberg statement.

General parameters

Compaction parameters

Deprecated storage config: The node-level storage config iceberg_compaction_write_parquet_max_row_group_rows is deprecated. Use the sink-level parameter compaction.write_parquet_max_row_group_rows instead.

Examples

Full compaction (default)

The following example enables automatic compaction with the default full compaction type:

Small files compaction

For Merge-on-Read tables with many small files, use the small-files compaction type to only compact files smaller than a threshold:

Files with delete compaction

For Merge-on-Read tables with accumulated delete files, use the files-with-delete compaction type to only compact data files that have associated delete files:

Manual maintenance

In addition to automatic background maintenance, you can trigger compaction and snapshot expiration manually at any time using the VACUUM command. This gives you on-demand control over table optimization and storage cleanup.