jcamachor commented on a change in pull request #1119: URL: https://github.com/apache/hive/pull/1119#discussion_r446442884
########## File path: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java ########## @@ -101,6 +102,65 @@ private volatile boolean isSparkConfigUpdated = false; private static final int LOG_PREFIX_LENGTH = 64; + interface HiveConfEnum<T extends Enum<T>> { + public static <T extends Enum<T>> T from(Class<T> cls, String value, T invalidEnum) { + try { + return T.valueOf(cls, value.toUpperCase()); + } catch (Exception e) { + return invalidEnum; + } + } + } Review comment: I am not sure we need the interface indeed, probably the utility method would suffice? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org