jerqi commented on code in PR #10315:
URL: https://github.com/apache/iceberg/pull/10315#discussion_r1609365261


##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/SparkConfParser.java:
##########
@@ -233,19 +229,20 @@ public EnumConfParser<T> defaultValue(String value) {
     }
 
     public T parse() {
-      Preconditions.checkArgument(defaultValue != null, "Default value cannot 
be null");
-      return parse(toEnum, defaultValue);
+      return parseAndCheck(toEnum, defaultValue);
     }
 
     public T parseOptional() {
-      return parse(toEnum, defaultValue);
+      return parseOptionalAndCheck(toEnum, defaultValue);
     }
   }
 
   abstract class ConfParser<ThisT, T> {
     private final List<String> optionNames = Lists.newArrayList();
     private String sessionConfName;
     private String tablePropertyName;
+    private Predicate<T> check;

Review Comment:
   Maybe `validator` or `checker` is a better name.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to