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.

Attributes

ENV_ID

DAG_ID

CATALOG

BASE_LOCATION

NAMESPACE

TABLE

POLICY

create_catalog

test_run

Module Contents

tests.system.apache.polaris.example_polaris_policies.ENV_ID[source]
tests.system.apache.polaris.example_polaris_policies.DAG_ID = 'example_polaris_policies'[source]
tests.system.apache.polaris.example_polaris_policies.CATALOG[source]
tests.system.apache.polaris.example_polaris_policies.BASE_LOCATION[source]
tests.system.apache.polaris.example_polaris_policies.NAMESPACE = 'sales'[source]
tests.system.apache.polaris.example_polaris_policies.TABLE = 'orders'[source]
tests.system.apache.polaris.example_polaris_policies.POLICY[source]
tests.system.apache.polaris.example_polaris_policies.create_catalog[source]
tests.system.apache.polaris.example_polaris_policies.test_run[source]

Was this entry helpful?