roryqi commented on code in PR #10874:
URL: https://github.com/apache/gravitino/pull/10874#discussion_r3152164709


##########
core/src/main/java/org/apache/gravitino/catalog/HierarchicalSchemaUtil.java:
##########
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.catalog;
+
+import com.google.common.base.Preconditions;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Pattern;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.gravitino.Config;
+import org.apache.gravitino.Configs;
+import org.apache.gravitino.GravitinoEnv;
+
+/**
+ * Utility class for hierarchical schema name conversions.
+ *
+ * <p>Gravitino supports nested namespace semantics where a logical schema 
name like {@code A:B:C}
+ * (using a configurable external separator, default {@code :}) is mapped to a 
physical schema name
+ * {@code A.B.C} stored in {@code EntityStore} using {@code .} as the internal 
separator.
+ *
+ * <p>Schema names in {@code EntityStore} never contain the external 
separator; the external
+ * separator is only used at the API boundary and in catalog capability 
validation.
+ */
+public final class HierarchicalSchemaUtil {
+
+  /** The internal separator used in EntityStore for nested schema names. */
+  private static final String PHYSICAL_SEPARATOR = ".";
+
+  private HierarchicalSchemaUtil() {}
+
+  /**
+   * Returns the configured external namespace separator from the server 
configuration. All code
+   * that needs the separator should use this method instead of reading the 
config directly.
+   *
+   * @return the configured separator string (default {@code ":"})
+   */
+  public static String namespaceSeparator() {

Review Comment:
   Make sense.



-- 
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