eric-maynard commented on code in PR #2422: URL: https://github.com/apache/polaris/pull/2422#discussion_r2301515791
########## runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java: ########## @@ -1083,6 +1093,74 @@ private void validateNoLocationOverlap( } } + /** Checks whether the location of a namespace is valid given its parent */ + private void validateNamespaceLocation( + NamespaceEntity namespace, PolarisResolvedPathWrapper resolvedParent) { + StorageLocation namespaceLocation = + StorageLocation.of( + StorageLocation.ensureTrailingSlash( + resolveNamespaceLocation(namespace.asNamespace(), namespace.getPropertiesAsMap()))); + PolarisEntity parent = resolvedParent.getResolvedLeafEntity().getEntity(); + if (parent.getType().equals(PolarisEntityType.CATALOG)) { + CatalogEntity parentEntity = CatalogEntity.of(parent); + LOGGER.debug( + "Validating namespace {} given parent catalog {}", + namespace.getName(), + parentEntity.getName()); + var storageConfigInfo = parentEntity.getStorageConfigurationInfo(); + if (storageConfigInfo == null) { + throw new IllegalArgumentException( + "Cannot create namespace without a parent storage configuration"); + } + List<StorageLocation> defaultLocations = + parentEntity.getStorageConfigurationInfo().getAllowedLocations().stream() + .filter(java.util.Objects::nonNull) + .map( + l -> { + return StorageLocation.ensureTrailingSlash( + StorageLocation.ensureTrailingSlash(l) + namespace.getName()); + }) Review Comment: <img width="793" height="174" alt="Screenshot 2025-08-26 at 9 22 03 AM" src="https://github.com/user-attachments/assets/f8634562-1cd0-4939-b054-0a0a9f223723" /> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org