jerqi commented on code in PR #6063:
URL: https://github.com/apache/gravitino/pull/6063#discussion_r1901432415


##########
core/src/main/java/org/apache/gravitino/utils/NameIdentifierUtil.java:
##########
@@ -265,6 +265,33 @@ public static NameIdentifier 
getCatalogIdentifier(NameIdentifier ident)
     return NameIdentifier.of(allElems.get(0), allElems.get(1));
   }
 
+  /**
+   * Try to get the schema {@link NameIdentifier} from the given {@link 
NameIdentifier}.
+   *
+   * @param ident The {@link NameIdentifier} to check.
+   * @return The schema {@link NameIdentifier}
+   * @throws IllegalNameIdentifierException If the given {@link 
NameIdentifier} does not include
+   *     schema name
+   */
+  public static NameIdentifier getSchemaIdentifier(NameIdentifier ident)
+      throws IllegalNameIdentifierException {
+    NameIdentifier.check(
+        ident.name() != null, "The name variable in the NameIdentifier must 
have value.");
+    Namespace.check(
+        ident.namespace() != null && !ident.namespace().isEmpty(),
+        "Catalog namespace must be non-null and have 1 level, the input 
namespace is %s",

Review Comment:
   I mean the word `have 1 level` is not correct. It should be `not empty` or 
`at least 1 level`.



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