LuciferYang commented on code in PR #50294: URL: https://github.com/apache/spark/pull/50294#discussion_r1998215052
########## sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala: ########## @@ -362,17 +363,35 @@ object SQLConf { "for using switch statements in InSet must be non-negative and less than or equal to 600") .createWithDefault(400) + private val VALIED_LOG_LEVELS: Array[String] = Level.values.map(_.toString) Review Comment: typo: `VALIED_LOG_LEVELS` -> `VALID_LOG_LEVELS` ########## sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala: ########## @@ -362,17 +363,35 @@ object SQLConf { "for using switch statements in InSet must be non-negative and less than or equal to 600") .createWithDefault(400) + private val VALIED_LOG_LEVELS: Array[String] = Level.values.map(_.toString) + + private def isValidLogLevel(level: String): Boolean = + VALIED_LOG_LEVELS.contains(level.toUpperCase(Locale.ROOT)) + + private def toLogLevel(upperCaseValidLevel: String): Level = { + require(VALIED_LOG_LEVELS.contains(upperCaseValidLevel)) + upperCaseValidLevel match { Review Comment: Can we directly use `Level.valueOf(upperCaseValidLevel)` after ` require(VALIED_LOG_LEVELS.contains(upperCaseValidLevel))` -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org