gaborkaszab commented on code in PR #15903:
URL: https://github.com/apache/iceberg/pull/15903#discussion_r3333068401
##########
core/src/main/java/org/apache/iceberg/rest/RESTCatalogProperties.java:
##########
@@ -81,19 +79,11 @@ public String modeName() {
}
public static ScanPlanningMode fromString(String mode) {
- for (ScanPlanningMode planningMode : values()) {
- if (planningMode.modeName().equalsIgnoreCase(mode)) {
- return planningMode;
- }
+ try {
+ return ScanPlanningMode.valueOf(mode.toUpperCase(Locale.ROOT));
+ } catch (IllegalArgumentException e) {
+ throw new IllegalArgumentException(String.format("Invalid scan
planning mode: %s", mode));
Review Comment:
Yes, we hade a conversation on this before without getting to a conclusion.
I was arguing that it's overkill to include the possible values, it could be
part of the spec but no point on the client code. However, that is unrelated to
this PR, so I'll revert back to the original state.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]