From b316d373658089a6fc52938eb84e5be6b97734a1 Mon Sep 17 00:00:00 2001 From: Maxim Gekk Date: Thu, 2 Jan 2020 09:56:50 +0900 Subject: [PATCH] [SPARK-30401][SQL] Call `requireNonStaticConf()` only once in `set()` ### What changes were proposed in this pull request? Calls of `requireNonStaticConf()` are removed from the `set()` methods in RuntimeConfig because those methods invoke `def set(key: String, value: String): Unit` where `requireNonStaticConf()` is called as well. ### Why are the changes needed? To avoid unnecessary calls of `requireNonStaticConf()`. ### Does this PR introduce any user-facing change? No ### How was this patch tested? By existing tests from `SQLConfSuite` Closes #27062 from MaxGekk/call-requireNonStaticConf-once. Authored-by: Maxim Gekk Signed-off-by: HyukjinKwon --- .../src/main/scala/org/apache/spark/sql/RuntimeConfig.scala | 2 -- 1 file changed, 2 deletions(-) diff --git a/sql/core/src/main/scala/org/apache/spark/sql/RuntimeConfig.scala b/sql/core/src/main/scala/org/apache/spark/sql/RuntimeConfig.scala index 0f5aab7f47d0d..2f46fa8073bbc 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/RuntimeConfig.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/RuntimeConfig.scala @@ -47,7 +47,6 @@ class RuntimeConfig private[sql](sqlConf: SQLConf = new SQLConf) { * @since 2.0.0 */ def set(key: String, value: Boolean): Unit = { - requireNonStaticConf(key) set(key, value.toString) } @@ -57,7 +56,6 @@ class RuntimeConfig private[sql](sqlConf: SQLConf = new SQLConf) { * @since 2.0.0 */ def set(key: String, value: Long): Unit = { - requireNonStaticConf(key) set(key, value.toString) }