jerqi commented on code in PR #10315: URL: https://github.com/apache/iceberg/pull/10315#discussion_r1609368411
########## spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/SparkConfParser.java: ########## @@ -264,7 +261,26 @@ public ThisT tableProperty(String name) { return self(); } - protected T parse(Function<String, T> conversion, T defaultValue) { + public ThisT check(Predicate<T> newCheck, String newErrMsg) { + this.check = newCheck; + this.errMsg = newErrMsg; + return self(); + } + + protected T parseAndCheck(Function<String, T> conversion, T defaultValue) { + T value = parse(conversion, defaultValue); + Preconditions.checkArgument(value != null, "Value cannot be null"); + check(value); + return value; + } + + protected T parseOptionalAndCheck(Function<String, T> conversion, T defaultValue) { + T value = parse(conversion, defaultValue); + check(value); Review Comment: Should we skip the check if this value is null for optional config? -- 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