You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polaris.apache.org by yu...@apache.org on 2026/08/28 18:51:33 UTC
(polaris) branch main updated: Fix setup round trips for dotted namespace levels (#5292)
This is an automated email from the ASF dual-hosted git repository.
flyrain pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git
The following commit(s) were added to refs/heads/main by this push:
new ba152c04f7 Fix setup round trips for dotted namespace levels (#5292)
ba152c04f7 is described below
commit ba152c04f7f985bbaeb487a55ef442df52321afe
Author: Matt Faltyn <76...@users.noreply.github.com>
AuthorDate: Fri Aug 28 20:51:27 2026 +0200
Fix setup round trips for dotted namespace levels (#5292)
---
CHANGELOG.md | 4 +
.../python/apache_polaris/cli/command/policies.py | 10 +-
client/python/apache_polaris/cli/command/setup.py | 134 ++++++++++--------
client/python/tests/test_setup_command.py | 154 +++++++++++++++++++--
.../assets/polaris/reference-setup-config.yaml | 21 +--
.../unreleased/getting-started/setup-tools.md | 3 +-
6 files changed, 247 insertions(+), 79 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 15b34d89c0..a16d137d4d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -84,6 +84,10 @@ request adding CHANGELOG notes for breaking (!) changes and possibly other secti
- Iceberg REST: server-side JSON processing failures (HTTP 500) now return the standard Iceberg
error envelope (`{"error": {...}}`) instead of a flat `{"code", "message"}` body, so Iceberg
clients can parse the response rather than failing on an off-schema shape.
+- Python CLI `setup export` now represents namespace paths as lists of levels in namespace,
+ policy, and namespace-privilege entries. This preserves namespace levels that contain dots during
+ `setup apply`; apply remains compatible with existing dot-delimited configurations. Older CLI
+ versions cannot apply the new export format.
- Python CLI `setup export` now writes each catalog's `policies` as a list of
`{name, namespace, ...}` entries instead of the previous name-keyed mapping, preserving policies
with the same name in different namespaces. The new export format cannot be applied by older CLI
diff --git a/client/python/apache_polaris/cli/command/policies.py b/client/python/apache_polaris/cli/command/policies.py
index 73fed37667..9a32a41176 100644
--- a/client/python/apache_polaris/cli/command/policies.py
+++ b/client/python/apache_polaris/cli/command/policies.py
@@ -20,7 +20,7 @@
import json
from dataclasses import dataclass, field
-from typing import Optional, Dict, List, cast
+from typing import Optional, Dict, List, Union, cast
from apache_polaris.cli.command import Command
from apache_polaris.cli.command.utils import get_catalog_api_client
@@ -53,7 +53,7 @@ class PoliciesCommand(Command):
policies_subcommand: str
catalog_name: Optional[str] = None
- namespace: Optional[str] = None
+ namespace: Optional[Union[str, List[str]]] = None
policy_name: Optional[str] = None
policy_file: Optional[str] = None
policy_type: Optional[str] = None
@@ -127,7 +127,11 @@ class PoliciesCommand(Command):
policy_name = cast(str, self.policy_name)
namespace_str = (
- self.namespace.replace(".", UNIT_SEPARATOR) if self.namespace else ""
+ UNIT_SEPARATOR.join(self.namespace)
+ if isinstance(self.namespace, list)
+ else self.namespace.replace(".", UNIT_SEPARATOR)
+ if self.namespace
+ else ""
)
if self.policies_subcommand == Subcommands.CREATE:
policy_file = cast(str, self.policy_file)
diff --git a/client/python/apache_polaris/cli/command/setup.py b/client/python/apache_polaris/cli/command/setup.py
index 6fa1d76461..196856421b 100644
--- a/client/python/apache_polaris/cli/command/setup.py
+++ b/client/python/apache_polaris/cli/command/setup.py
@@ -85,6 +85,18 @@ class SetupCommand(Command):
self._catalog_api = get_catalog_api_client(api)
return self._catalog_api
+ @staticmethod
+ def _namespace_parts(namespace: Any) -> Optional[List[str]]:
+ if isinstance(namespace, str):
+ return namespace.split(".")
+ if (
+ isinstance(namespace, list)
+ and namespace
+ and all(isinstance(part, str) and part for part in namespace)
+ ):
+ return namespace
+ return None
+
def _get_existing_principals(self, api: PolarisDefaultApi) -> Set[str]:
"""Fetch and cache the set of existing principal names."""
if self._existing_principals is None:
@@ -436,17 +448,23 @@ class SetupCommand(Command):
]
if catalog_privs:
privileges["catalog"] = sorted(catalog_privs)
- ns_privs: Dict[str, List[str]] = {}
+ ns_privs: Dict[tuple[str, ...], List[str]] = {}
for p in privs:
if p.type.lower() == "namespace":
- ns_name = ".".join(p.namespace)
- if ns_name not in ns_privs:
- ns_privs[ns_name] = []
- ns_privs[ns_name].append(p.privilege.value)
- for ns_name in ns_privs:
- ns_privs[ns_name] = sorted(ns_privs[ns_name])
+ namespace = tuple(p.namespace)
+ if namespace not in ns_privs:
+ ns_privs[namespace] = []
+ ns_privs[namespace].append(p.privilege.value)
if ns_privs:
- privileges["namespace"] = ns_privs
+ privileges["namespace"] = [
+ {
+ "namespace": list(namespace),
+ "privileges": sorted(namespace_privileges),
+ }
+ for namespace, namespace_privileges in sorted(
+ ns_privs.items()
+ )
+ ]
if privileges:
role_info["privileges"] = privileges
roles_map[r.name] = role_info
@@ -483,11 +501,10 @@ class SetupCommand(Command):
catalog_api = IcebergCatalogAPI(catalog_api_client)
try:
for ns in namespaces:
- ns_name = ".".join(ns)
ns_details = catalog_api.load_namespace_metadata(
prefix=catalog_name, namespace=UNIT_SEPARATOR.join(ns)
)
- ns_info: Dict[str, Any] = {"name": ns_name}
+ ns_info: Dict[str, Any] = {"name": ns}
if ns_details.properties:
ns_info["properties"] = ns_details.properties
namespaces_list.append(ns_info)
@@ -509,8 +526,7 @@ class SetupCommand(Command):
try:
policy_api = PolicyAPI(catalog_api_client)
for ns in namespaces:
- ns_name = ".".join(ns)
- namespace_str = ns_name.replace(".", UNIT_SEPARATOR)
+ namespace_str = UNIT_SEPARATOR.join(ns)
policies = policy_api.list_policies(
prefix=catalog_name, namespace=namespace_str
).identifiers
@@ -532,7 +548,7 @@ class SetupCommand(Command):
compact_content = policy_obj.content
policy_info = {
"name": p.name,
- "namespace": ns_name,
+ "namespace": ns,
"type": policy_obj.policy_type,
"content": compact_content,
}
@@ -1157,7 +1173,17 @@ class SetupCommand(Command):
self._grant_privilege(
api, catalog_name, role_name, "catalog", priv, dry_run=dry_run
)
- for ns_name, privs in privileges_to_grant.get("namespace", {}).items():
+ namespace_privileges = privileges_to_grant.get("namespace", {})
+ namespace_privilege_entries = (
+ namespace_privileges.items()
+ if isinstance(namespace_privileges, dict)
+ else (
+ (entry.get("namespace"), entry.get("privileges", []))
+ for entry in namespace_privileges
+ if isinstance(entry, dict)
+ )
+ )
+ for namespace, privs in namespace_privilege_entries:
for priv in privs:
self._grant_privilege(
api,
@@ -1165,7 +1191,7 @@ class SetupCommand(Command):
role_name,
"namespace",
priv,
- namespace=ns_name,
+ namespace=namespace,
dry_run=dry_run,
)
logger.info(
@@ -1179,7 +1205,7 @@ class SetupCommand(Command):
catalog_role_name: str,
level: str,
privilege: str,
- namespace: Optional[str] = None,
+ namespace: Optional[Union[str, List[str]]] = None,
dry_run: bool = False,
) -> None:
"""Helper to grant a single privilege."""
@@ -1203,6 +1229,7 @@ class SetupCommand(Command):
logger.warning(f"Unsupported privilege level '{level}'")
return
+ namespace_parts = self._namespace_parts(namespace)
cmd = PrivilegesCommand(
privileges_subcommand=privileges_subcommand,
action=Actions.GRANT,
@@ -1210,9 +1237,7 @@ class SetupCommand(Command):
privilege=privilege,
catalog_role_name=catalog_role_name,
catalog_name=catalog_name,
- namespace=namespace.split(".")
- if level == "namespace" and namespace
- else None,
+ namespace=namespace_parts if level == "namespace" else None,
)
cmd.validate()
cmd.execute(api)
@@ -1231,70 +1256,70 @@ class SetupCommand(Command):
logger.info(f"--- Processing namespaces for catalog: {catalog_name} ---")
catalog_api_client = self._get_catalog_api(api)
catalog_api = IcebergCatalogAPI(catalog_api_client)
- existing_namespaces: Set[str] = set()
- listed_parents: Set[str] = set()
+ existing_namespaces: Set[tuple[str, ...]] = set()
+ listed_parents: Set[tuple[str, ...]] = set()
- listed_parents.add("")
- all_namespaces_to_create = set()
- namespace_data_map = {}
+ listed_parents.add(())
+ all_namespaces_to_create: Set[tuple[str, ...]] = set()
+ namespace_data_map: Dict[tuple[str, ...], Dict[str, Any]] = {}
for ns_item in namespaces_config:
- ns_name: Optional[str]
+ namespace: Any
ns_data: Dict[str, Any]
- if isinstance(ns_item, str):
- ns_name = ns_item
+ if isinstance(ns_item, (str, list)):
+ namespace = ns_item
ns_data = {}
elif isinstance(ns_item, dict):
- ns_name = ns_item.get("name")
+ namespace = ns_item.get("name")
ns_data = ns_item
else:
logger.warning(f"Skipping invalid namespace entry: {ns_item}")
continue
- if not ns_name:
+ parsed_parts = self._namespace_parts(namespace)
+ if not parsed_parts:
logger.warning(
f"Skipping namespace with no name in catalog '{catalog_name}'"
)
continue
+ namespace_key = tuple(parsed_parts)
# Store data for the full namespace path
- namespace_data_map[ns_name] = ns_data
+ namespace_data_map[namespace_key] = ns_data
# Add the full namespace and all its parents to the set
- parts = ns_name.split(".")
- for i in range(len(parts)):
- parent_ns_name = ".".join(parts[: i + 1])
- all_namespaces_to_create.add(parent_ns_name)
- sorted_namespaces = sorted(list(all_namespaces_to_create))
- for ns_name in sorted_namespaces:
- parts = ns_name.split(".")
- if len(parts) > 1:
- parent_ns = ".".join(parts[:-1])
+ for i in range(len(parsed_parts)):
+ all_namespaces_to_create.add(namespace_key[: i + 1])
+ for namespace_key in sorted(all_namespaces_to_create):
+ ns_name = ".".join(namespace_key)
+ if len(namespace_key) > 1:
+ parent = namespace_key[:-1]
+ parent_ns = ".".join(parent)
if (
not dry_run
- and parent_ns in existing_namespaces
- and parent_ns not in listed_parents
+ and parent in existing_namespaces
+ and parent not in listed_parents
):
try:
sub_ns = catalog_api.list_namespaces(
- prefix=catalog_name, parent=UNIT_SEPARATOR.join(parts[:-1])
+ prefix=catalog_name, parent=UNIT_SEPARATOR.join(parent)
).namespaces
for ns in sub_ns:
- existing_namespaces.add(".".join(ns))
- listed_parents.add(parent_ns)
+ existing_namespaces.add(tuple(ns))
+ listed_parents.add(parent)
except Exception:
self._record_failure(
f"Failed to list sub-namespaces for '{parent_ns}'"
)
- if ns_name in existing_namespaces:
+ if namespace_key in existing_namespaces:
logger.info(
f"Skipping creation for already existing namespace '{ns_name}' in catalog '{catalog_name}'"
)
continue
# Get data if it exists for this specific namespace, otherwise empty
- ns_data = namespace_data_map.get(ns_name, {})
+ ns_data = namespace_data_map.get(namespace_key, {})
if dry_run:
self._log_dry_run(
"create", "namespace", ns_name, {"catalog": catalog_name, **ns_data}
)
- existing_namespaces.add(ns_name)
+ existing_namespaces.add(namespace_key)
else:
try:
logger.info(
@@ -1303,7 +1328,7 @@ class SetupCommand(Command):
cmd = NamespacesCommand(
namespaces_subcommand=Subcommands.CREATE,
catalog=catalog_name,
- namespace=ns_name.split("."),
+ namespace=list(namespace_key),
location=ns_data.get("location"),
properties=ns_data.get("properties"),
)
@@ -1312,12 +1337,12 @@ class SetupCommand(Command):
logger.info(
f"Namespace '{ns_name}' created successfully in catalog '{catalog_name}'."
)
- existing_namespaces.add(ns_name)
+ existing_namespaces.add(namespace_key)
except ConflictException:
logger.info(
f"Namespace '{ns_name}' already exists in catalog '{catalog_name}'."
)
- existing_namespaces.add(ns_name)
+ existing_namespaces.add(namespace_key)
except Exception:
self._record_failure(
f"Failed to create namespace '{ns_name}' in catalog '{catalog_name}'"
@@ -1347,15 +1372,16 @@ class SetupCommand(Command):
logger.warning("Skipping policy due to missing name.")
continue
ns_name = policy_data.get("namespace")
- if not ns_name:
+ namespace_parts = self._namespace_parts(ns_name)
+ if not namespace_parts:
logger.warning(
f"Skipping policy '{policy_name}' due to missing namespace."
)
continue
+ namespace_str = UNIT_SEPARATOR.join(namespace_parts)
# Check if policy exists
policy_exists = False
try:
- namespace_str = ns_name.replace(".", UNIT_SEPARATOR)
policy_api.load_policy(
prefix=catalog_name,
namespace=namespace_str,
@@ -1427,7 +1453,7 @@ class SetupCommand(Command):
policy_content_str = json.dumps(json.load(f))
policy_api.create_policy(
prefix=catalog_name,
- namespace=ns_name.replace(".", UNIT_SEPARATOR),
+ namespace=namespace_str,
create_policy_request=CreatePolicyRequest(
name=policy_name,
type=policy_data["type"],
@@ -1467,7 +1493,7 @@ class SetupCommand(Command):
cmd = PoliciesCommand(
policies_subcommand=Subcommands.ATTACH,
catalog_name=catalog_name,
- namespace=ns_name,
+ namespace=namespace_parts,
policy_name=policy_name,
attachment_type=attachment_type,
attachment_path=attachment_path,
diff --git a/client/python/tests/test_setup_command.py b/client/python/tests/test_setup_command.py
index 9eb19d698a..90a9821a14 100644
--- a/client/python/tests/test_setup_command.py
+++ b/client/python/tests/test_setup_command.py
@@ -531,14 +531,15 @@ class TestSetupCommand(CLITestBase):
catalog = command._export_catalogs(mock_client)[0]
self.assertEqual(
- catalog["namespaces"], [{"name": "parent"}, {"name": "parent.child"}]
+ catalog["namespaces"],
+ [{"name": ["parent"]}, {"name": ["parent", "child"]}],
)
self.assertEqual(
catalog["policies"],
[
{
"name": "child-policy",
- "namespace": "parent.child",
+ "namespace": ["parent", "child"],
"type": "data-compaction",
"content": '{"max-age":7}',
}
@@ -565,6 +566,46 @@ class TestSetupCommand(CLITestBase):
]
)
+ @patch("apache_polaris.cli.command.setup.NamespacesCommand")
+ @patch("apache_polaris.cli.command.setup.IcebergCatalogAPI")
+ def test_setup_exported_dotted_namespace_levels_round_trip_without_colliding(
+ self,
+ mock_catalog_api_class: MagicMock,
+ mock_namespaces_command: MagicMock,
+ ) -> None:
+ catalog_api = mock_catalog_api_class.return_value
+ catalog_api.load_namespace_metadata.return_value = GetNamespaceResponse(
+ namespace=["finance.us"], properties={}
+ )
+ catalog_api.list_namespaces.return_value = SimpleNamespace(namespaces=[])
+ export_command = SetupCommand(
+ setup_subcommand=Subcommands.EXPORT,
+ _catalog_api=MagicMock(),
+ )
+
+ exported = export_command._export_namespaces_for_catalog(
+ MagicMock(), "catalog", [["finance.us"], ["finance", "us"]]
+ )
+ loaded = yaml.safe_load(yaml.safe_dump({"namespaces": exported}))
+
+ apply_command = SetupCommand(
+ setup_subcommand=Subcommands.APPLY,
+ _catalog_api=MagicMock(),
+ )
+ apply_command._create_namespaces(MagicMock(), "catalog", loaded["namespaces"])
+
+ self.assertEqual(
+ exported,
+ [{"name": ["finance.us"]}, {"name": ["finance", "us"]}],
+ )
+ self.assertEqual(
+ [
+ namespace_call.kwargs["namespace"]
+ for namespace_call in mock_namespaces_command.call_args_list
+ ],
+ [["finance"], ["finance", "us"], ["finance.us"]],
+ )
+
@patch("apache_polaris.cli.command.setup.PolicyAPI")
def test_setup_exported_policy_content_round_trips_through_apply(
self, mock_policy_api_class: MagicMock
@@ -608,15 +649,17 @@ class TestSetupCommand(CLITestBase):
self.assertEqual(request.content, policy_content)
@patch("apache_polaris.cli.command.setup.PolicyAPI")
- def test_setup_export_preserves_same_named_policies_across_namespaces(
+ def test_setup_export_preserves_policies_across_ambiguous_namespace_names(
self, mock_policy_api_class: MagicMock
) -> None:
policy_api = mock_policy_api_class.return_value
- policy_api.list_policies.side_effect = lambda prefix, namespace: SimpleNamespace(
- identifiers=(
- [SimpleNamespace(name="retention")]
- if namespace in {"finance", "science"}
- else []
+ policy_api.list_policies.side_effect = lambda prefix, namespace: (
+ SimpleNamespace(
+ identifiers=(
+ [SimpleNamespace(name="retention")]
+ if namespace in {"finance.us", f"finance{UNIT_SEPARATOR}us"}
+ else []
+ )
)
)
policy_api.load_policy.side_effect = [
@@ -643,7 +686,7 @@ class TestSetupCommand(CLITestBase):
_catalog_api=MagicMock(),
)
exported_policies = export_command._export_policies_for_catalog(
- MagicMock(), "catalog", [["finance"], ["science"]]
+ MagicMock(), "catalog", [["finance.us"], ["finance", "us"]]
)
loaded_config = yaml.safe_load(yaml.safe_dump({"policies": exported_policies}))
@@ -667,11 +710,97 @@ class TestSetupCommand(CLITestBase):
for create_call in policy_api.create_policy.call_args_list
],
[
- ("finance", "retention", '{"max-age":7}'),
- ("science", "retention", '{"max-age":30}'),
+ ("finance.us", "retention", '{"max-age":7}'),
+ (f"finance{UNIT_SEPARATOR}us", "retention", '{"max-age":30}'),
+ ],
+ )
+
+ def test_setup_exported_namespace_privileges_round_trip_without_colliding(
+ self,
+ ) -> None:
+ export_client = self.build_mock_client()
+ export_client.list_catalog_roles.return_value = SimpleNamespace(
+ roles=[SimpleNamespace(name="reader", properties={})]
+ )
+ export_client.list_assignee_principal_roles_for_catalog_role.return_value = (
+ SimpleNamespace(roles=[])
+ )
+ export_client.list_grants_for_catalog_role.return_value = SimpleNamespace(
+ grants=[
+ SimpleNamespace(
+ type="namespace",
+ namespace=["finance.us"],
+ privilege=SimpleNamespace(value="TABLE_READ_DATA"),
+ ),
+ SimpleNamespace(
+ type="namespace",
+ namespace=["finance", "us"],
+ privilege=SimpleNamespace(value="TABLE_WRITE_DATA"),
+ ),
+ ]
+ )
+ export_command = SetupCommand(setup_subcommand=Subcommands.EXPORT)
+
+ exported = export_command._export_catalog_roles_for_catalog(
+ export_client, "catalog"
+ )
+ loaded = yaml.safe_load(yaml.safe_dump(exported))
+
+ apply_client = self.build_mock_client()
+ apply_client.list_catalog_roles.return_value = SimpleNamespace(
+ roles=[SimpleNamespace(name="reader")]
+ )
+ apply_command = SetupCommand(setup_subcommand=Subcommands.APPLY)
+ apply_command._create_catalog_roles(apply_client, "catalog", loaded)
+
+ self.assertEqual(
+ exported["reader"]["privileges"]["namespace"],
+ [
+ {
+ "namespace": ["finance", "us"],
+ "privileges": ["TABLE_WRITE_DATA"],
+ },
+ {
+ "namespace": ["finance.us"],
+ "privileges": ["TABLE_READ_DATA"],
+ },
+ ],
+ )
+ self.assertEqual(
+ [
+ (
+ grant_call.args[2].grant.namespace,
+ grant_call.args[2].grant.privilege.value,
+ )
+ for grant_call in apply_client.add_grant_to_catalog_role.call_args_list
+ ],
+ [
+ (["finance", "us"], "TABLE_WRITE_DATA"),
+ (["finance.us"], "TABLE_READ_DATA"),
],
)
+ def test_setup_apply_accepts_legacy_namespace_privilege_mapping(self) -> None:
+ apply_client = self.build_mock_client()
+ apply_client.list_catalog_roles.return_value = SimpleNamespace(
+ roles=[SimpleNamespace(name="reader")]
+ )
+ apply_command = SetupCommand(setup_subcommand=Subcommands.APPLY)
+
+ apply_command._create_catalog_roles(
+ apply_client,
+ "catalog",
+ {
+ "reader": {
+ "privileges": {"namespace": {"finance.us": ["TABLE_READ_DATA"]}}
+ }
+ },
+ )
+
+ grant = apply_client.add_grant_to_catalog_role.call_args.args[2].grant
+ self.assertEqual(grant.namespace, ["finance", "us"])
+ self.assertEqual(grant.privilege.value, "TABLE_READ_DATA")
+
def test_setup_export_reports_top_level_read_failures(self) -> None:
for method_name in (
"list_principals",
@@ -781,7 +910,8 @@ class TestSetupCommand(CLITestBase):
self.assertEqual(len(exported), 1)
self.assertEqual(
- exported[0]["endpoint_internal"], "https://bucket.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com"
+ exported[0]["endpoint_internal"],
+ "https://bucket.vpce-1a2b3c4d-5e6f.s3.us-west-2.vpce.amazonaws.com",
)
self.assertEqual(exported[0]["sts_endpoint"], "https://sts.amazonaws.com")
diff --git a/site/content/guides/assets/polaris/reference-setup-config.yaml b/site/content/guides/assets/polaris/reference-setup-config.yaml
index d3ace5353d..d9cc7b773c 100644
--- a/site/content/guides/assets/polaris/reference-setup-config.yaml
+++ b/site/content/guides/assets/polaris/reference-setup-config.yaml
@@ -108,21 +108,24 @@ catalogs:
privileges:
# Privileges scoped to specific namespaces within this catalog
namespace:
- dev_namespace:
- - TABLE_READ_DATA
- - TABLE_WRITE_DATA
- - TABLE_FULL_METADATA
+ - namespace: [dev_namespace]
+ privileges:
+ - TABLE_READ_DATA
+ - TABLE_WRITE_DATA
+ - TABLE_FULL_METADATA
# --- Namespaces ---
- # List of namespaces to create within this catalog.
+ # List of namespaces to create within this catalog. Each name is a list of
+ # namespace levels so dots within one level are preserved. Legacy
+ # dot-delimited strings such as dev_namespace.sub_namespace are also accepted.
namespaces:
- - dev_namespace.sub_namespace
+ - name: [dev_namespace, sub_namespace]
# --- Policies ---
# Defines policies that can be attached to entities in this catalog.
policies:
- name: compaction-policy
- namespace: dev_namespace
+ namespace: [dev_namespace]
type: "system.data-compaction"
description: "Policy to enable data compaction for tables"
content: {
@@ -139,7 +142,7 @@ catalogs:
# attach:
# - { type: table-like, path: dev_namespace.sub_namespace.dev_table }
- name: snapshot-expiry-policy
- namespace: dev_namespace
+ namespace: [dev_namespace]
type: "system.snapshot-expiry"
description: "Policy to expire old snapshots"
content: {
@@ -155,7 +158,7 @@ catalogs:
attach:
- { type: namespace, path: dev_namespace }
- name: orphan-file-policy
- namespace: dev_namespace
+ namespace: [dev_namespace]
type: "system.orphan-file-removal"
description: "Policy to remove orphan files"
content: {
diff --git a/site/content/in-dev/unreleased/getting-started/setup-tools.md b/site/content/in-dev/unreleased/getting-started/setup-tools.md
index 130d1a3ea6..52480a06c2 100644
--- a/site/content/in-dev/unreleased/getting-started/setup-tools.md
+++ b/site/content/in-dev/unreleased/getting-started/setup-tools.md
@@ -40,7 +40,7 @@ If you already have an Apache Polaris environment, you can export its current st
polaris setup export --client-id ${CLIENT_ID} --client-secret ${CLIENT_SECRET} > polaris_bootstrap.yaml
```
-This generates a readable YAML file containing principals, principal roles, catalogs, and their associated namespaces and catalog roles. User-defined properties on principals, principal roles, and catalog roles are preserved in the exported configuration.
+This generates a readable YAML file containing principals, principal roles, catalogs, and their associated namespaces and catalog roles. User-defined properties on principals, principal roles, and catalog roles are preserved in the exported configuration. Namespace paths are exported as lists of levels so that a dot within one level is distinct from a nested namespace. `setup apply` also accepts the legacy dot-delimited form, but use level lists when a namespace level contains a dot.
## Applying a Configuration
@@ -104,5 +104,6 @@ polaris setup apply --client-id ${CLIENT_ID} --client-secret ${CLIENT_SECRET} si
The current implementation focuses on simplifying initial setup, with a few limitations to be aware of:
- **Non-declarative updates**: The command is create-only. If an entity already exists, it will be skipped rather than updated. There is no state reconciliation yet.
+- **Namespace arguments outside setup**: Namespace level lists are supported only in setup configurations. Legacy setup strings and other CLI commands interpret dots as level separators, so they cannot address a single namespace level containing a dot.
- **Policy attachment export**: Policy attachments are not included in `setup export` due to performance considerations. However, they can still be defined in YAML and applied during `setup apply`.
- **External catalog testing**: Support for external catalogs (e.g., Hive Metastore) exists, but full end-to-end testing has not yet been completed. It is recommended to validate configurations in a non-production environment first.