roryqi commented on code in PR #10637:
URL: https://github.com/apache/gravitino/pull/10637#discussion_r3072136912
##########
lance/lance-common/src/main/java/org/apache/gravitino/lance/common/ops/gravitino/GravitinoLanceNameSpaceOperations.java:
##########
@@ -414,6 +408,56 @@ private <T> T[] buildChanges(
return Stream.concat(setPropertiesStream,
removePropertiesStream).toArray(arrayCreator);
}
+ private static CreateMode parseCreateMode(String instance, String mode) {
+ if (mode == null) {
+ return CreateMode.CREATE;
+ }
+ String normalized = CommonUtil.normalizeToken(mode);
+ if ("CREATE".equals(normalized)) {
+ return CreateMode.CREATE;
+ }
+ if ("EXISTOK".equals(normalized)) {
+ return CreateMode.EXIST_OK;
+ }
+ if ("OVERWRITE".equals(normalized)) {
+ return CreateMode.OVERWRITE;
+ }
+ throw new InvalidInputException(
+ "Unknown create namespace mode: " + mode,
CommonUtil.formatCurrentStackTrace(), instance);
+ }
+
+ private static DropMode parseDropMode(String instance, String mode) {
+ if (mode == null) {
+ return DropMode.FAIL;
+ }
+ String normalized = CommonUtil.normalizeToken(mode);
+ if ("FAIL".equals(normalized)) {
Review Comment:
Could u use `DropMode.valueOf(normalized)`?
--
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]