tests.system.apache.polaris.example_polaris_policies¶
Declare a table-maintenance policy in Polaris and fan out one task per (table, policy).
Polaris stores and resolves maintenance policies but does not run them. This Dag shows the
Airflow side: PolarisGetApplicablePoliciesOperator(per_table=True) resolves the policies in
effect on every table of a namespace (inheritance applied by Polaris), and dynamic task mapping
runs one maintenance task per item. Here the mapped task turns each item into the Iceberg
procedure call with to_spark_sql; a real deployment would run it on Spark.
The Dag creates its own catalog, namespace and table and removes them afterwards. It uses the polaris_default connection, whose principal
must be allowed to create catalogs.