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

CLEANARCHIVE

Notes and Constraints

This section applies only to versions MRS 3.2.1-LTS through MRS 3.3.1-LTS.

Function

This command is used to clean up Hudi archive files. This process reduces storage consumption and minimizes performance pressure on Hudi tables.

Syntax

set hoodie.archive.file.cleaner.policy = KEEP_ARCHIVED_FILES_BY_SIZE;

set hoodie.archive.file.cleaner.size.retained = 5368709120;

run cleanarchive on tableIdentifier/tablelocation;

set hoodie.archive.file.cleaner.policy = KEEP_ARCHIVED_FILES_BY_DAYS;

set hoodie.archive.file.cleaner.days.retained = 30;

run cleanarchive on tableIdentifier/tablelocation;

Parameter Description

Table 1 Parameter description

Parameter

Description

tableIdentifier

Name of the Hudi table

tablelocation

Storage path of the Hudi table

hoodie.archive.file.cleaner.policy

Policy for clearing archived files: Currently, only the KEEP_ARCHIVED_FILES_BY_SIZE and KEEP_ARCHIVED_FILES_BY_DAYS policies are supported. The default policy is KEEP_ARCHIVED_FILES_BY_DAYS.

  • KEEP_ARCHIVED_FILES_BY_SIZE: used to configure the maximum storage capacity allowed for archived files.
  • KEEP_ARCHIVED_FILES_BY_DAYS: used to define the retention period for archived files. Files older than the specified duration will be deleted.

hoodie.archive.file.cleaner.size.retained

When the policy is set to KEEP_ARCHIVED_FILES_BY_SIZE, this parameter specifies the total bytes of archived files to retain. The default value is 5368709120 bytes (5 GB).

hoodie.archive.file.cleaner.days.retained

When the policy is set to KEEP_ARCHIVED_FILES_BY_DAYS, this parameter specifies the number of days to retain archived files. The default value is 30 days.

Precautions

Archived files are not backed up. Once deleted, these files cannot be restored.

Response

You can view command execution results in the driver log or on the client.