Performing manual Iceberg table maintenance using Cloudera Lakehouse Optimizer REST APIs

You can use REST APIs to perform manual table maintenance as needed depending on your assigned role.

  1. Get the current statistics for the required table using the GET /tables/{tableId}/stats API.
    You can perform this step to view the current table statistics so that you can compare them with the expected statistics after the maintenance actions are complete.
  2. Dry run the policy to determine whether the generated maintenance actions are as expected using the PUT /policies/{policyName}/tables/{tableName}/dryrun API. The API evaluates the statistics and then generates only a set of maintenance actions.
  3. Initiate the evaluation phase using the POST /policies/{policyName}/tables/{tableName}/evaluation API.
    The 200 response shows a unique task ID that you can use to monitor the task and the task metadata.
  4. Monitor the status of the task using the GET /tasks or GET /tasks/id/{id} API.
  5. Verify whether the task completed the maintenance actions as expected using the GET /tables/{tableId}/stats API.