dimas-b commented on code in PR #4508:
URL: https://github.com/apache/polaris/pull/4508#discussion_r3276209693


##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java:
##########
@@ -1436,10 +1438,16 @@ public ConfigResponse getConfig() {
     Map<String, String> properties =
         
PolarisEntity.of(resolvedReferenceCatalog.getEntity()).getPropertiesAsMap();
 
-    String prefix = prefixParser().catalogNameToPrefix(catalogName());
     return ConfigResponse.builder()
         .withDefaults(properties) // catalog properties are defaults
-        .withOverrides(ImmutableMap.of("prefix", prefix))
+        .withOverrides(
+            ImmutableMap.of(
+                "prefix",
+                prefixParser().catalogNameToPrefix(catalogName()),
+                // Polaris does not handle custom namespace separators;
+                // always communicate the default namespace separator to 
clients.
+                RESTCatalogProperties.NAMESPACE_SEPARATOR,
+                NamespaceUtils.DEFAULT_NAMESPACE_SEPARATOR_ENCODED))

Review Comment:
   Can clients choose their own NS separator? If we do not set 
`RESTCatalogProperties.NAMESPACE_SEPARATOR`, isn't the client required to use 
the default one?
   
   If that works, I think it's cleaner to stick to defaults rather than 
emitting an explicit config entry whose value is equal to the default.



##########
polaris-core/src/main/java/org/apache/polaris/core/rest/PolarisResourcePaths.java:
##########
@@ -43,27 +49,46 @@ public class PolarisResourcePaths {
   public static final String V1_APPLICABLE_POLICIES = 
"/polaris/v1/{prefix}/applicable-policies";
 
   private final String prefix;
+  private final String namespaceSeparatorEncoded;
 
-  public PolarisResourcePaths(String prefix) {
+  public PolarisResourcePaths(String prefix, String namespaceSeparatorEncoded) 
{
     this.prefix = prefix;
+    this.namespaceSeparatorEncoded = namespaceSeparatorEncoded;
   }
 
   public static PolarisResourcePaths forCatalogProperties(Map<String, String> 
properties) {
-    return new PolarisResourcePaths(properties.get(PREFIX));
+    String namespaceSeparatorEncoded =
+        properties.getOrDefault(
+            RESTCatalogProperties.NAMESPACE_SEPARATOR,
+            RESTCatalogProperties.NAMESPACE_SEPARATOR_DEFAULT);
+    if 
(!namespaceSeparatorEncoded.equals(RESTCatalogProperties.NAMESPACE_SEPARATOR_DEFAULT))
 {
+      LOGGER.warn("Using non-default namespace separator '{}'", 
namespaceSeparatorEncoded);

Review Comment:
   Why WARN? Is it inherently risky?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to