RussellSpitzer commented on code in PR #9841: URL: https://github.com/apache/iceberg/pull/9841#discussion_r1571286633
########## spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/SparkConfParser.java: ########## @@ -196,6 +201,40 @@ private Duration toDuration(String time) { } } + class ReadTypeConfParser extends ConfParser<ReadTypeConfParser, ReaderType> { + private ReaderType defaultValue; + + @Override + protected ReadTypeConfParser self() { + return this; + } + + public ReadTypeConfParser defaultValue(ReaderType value) { + this.defaultValue = value; + return self(); + } + + public ReaderType parse() { + Preconditions.checkArgument(defaultValue != null, "Default value cannot be null"); + return parse(this::toReaderType, defaultValue); + } + + public ReaderType parseOptional() { + return parse(this::toReaderType, defaultValue); + } + + private ReaderType toReaderType(String value) { + switch (value.toUpperCase()) { Review Comment: why not enum.valueOf() -- 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