Understanding table-policy associations

Cloudera Lakehouse Optimizer maintains a table-policy association JSON file for each namespace.

After you define the policies using REST APIs for the first time, you must run the POST /policies/{policyName}/tables/{tableName}/subs API so that the Cloudera Lakehouse Optimizer modifies or appends the mapping of the Iceberg tables to the policies in the association file. You must run the PUT /policies/{policyName}/tables/{tableName}/subs API for subsequent associations.

Alternatively, to do a bulk-update of table-policy associations, you must download the existing file which you can update and then upload. If the file does not exist, create a JSON file, update it as required, and upload it using the PUT /policies/resource API, or use the curl --location --request PUT 'https://[*** LAKEHOUSE OPTIMIZER ENDPOINT ***]/api/v1/policies/resource' \ --form 'dlm://tpa/hive/n1=@"/path/to/file" command.

The following example shows an entry in the association file:
{
“Catalog_sales” : [“snapshot”, “manifests_orphan”, “compact”] //Catalog_sales is the Iceberg table name.
}