- 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.typewith thesmall-filesandfiles-with-deletecompaction types in v2.7.0. compaction.write_parquet_compressionandcompaction.write_parquet_max_row_group_rowswere added in v2.9.0. Thecompaction.target_file_size_mbparameter now also controls the output file size for sink writes (previously only applied to compaction).- Parameters prefixed with
compactionare currently in technical preview stage and may change in future releases.
Compaction types
RisingWave supports three compaction types for Iceberg tables. You can specify the type using thecompaction.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 theWITH clause of a CREATE SINK or CREATE TABLE ... ENGINE = iceberg statement.
General parameters
Compaction parameters
Examples
Full compaction (default)
The following example enables automatic compaction with the defaultfull compaction type:
Small files compaction
For Merge-on-Read tables with many small files, use thesmall-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 thefiles-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 theVACUUM command.
This gives you on-demand control over table optimization and storage cleanup.