bbiiaaoo commented on code in PR #10637:
URL: https://github.com/apache/gravitino/pull/10637#discussion_r3207159529


##########
lance/lance-common/src/main/java/org/apache/gravitino/lance/common/ops/gravitino/GravitinoLanceTableOperations.java:
##########
@@ -366,4 +377,37 @@ private JsonArrowSchema toJsonArrowSchema(Column[] 
columns) {
     return JsonArrowSchemaConverter.convertToJsonArrowSchema(
         new org.apache.arrow.vector.types.pojo.Schema(fields));
   }
+
+  private static String normalizeCreateMode(String mode, String tableId) {
+    if (mode == null) {
+      return "CREATE";
+    }
+    String normalized = CommonUtil.normalizeToken(mode);
+    if ("CREATE".equals(normalized)) {
+      return "CREATE";
+    }
+    if ("EXISTOK".equals(normalized)) {
+      return "EXIST_OK";
+    }
+    if ("OVERWRITE".equals(normalized)) {
+      return "OVERWRITE";
+    }

Review Comment:
   Agreed. I replaced the manual string comparisons with enum-based parsing for 
namespace and table modes.



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