Skip to content

Commit 37ebae4

Browse files
committed
Use ConfigEntry.findEntry().
1 parent 0320857 commit 37ebae4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import org.apache.spark.util.Utils
4545

4646
object SQLConf {
4747

48-
private val sqlConfEntries = java.util.Collections.synchronizedMap(
48+
private[sql] val sqlConfEntries = java.util.Collections.synchronizedMap(
4949
new java.util.HashMap[String, ConfigEntry[_]]())
5050

5151
val staticConfKeys: java.util.Set[String] =

sql/core/src/main/scala/org/apache/spark/sql/RuntimeConfig.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package org.apache.spark.sql
1919

20-
import org.apache.spark.SparkConf
2120
import org.apache.spark.annotation.InterfaceStability
2221
import org.apache.spark.internal.config.{ConfigEntry, OptionalConfigEntry}
2322
import org.apache.spark.sql.internal.SQLConf
@@ -155,7 +154,8 @@ class RuntimeConfig private[sql](sqlConf: SQLConf = new SQLConf) {
155154
if (SQLConf.staticConfKeys.contains(key)) {
156155
throw new AnalysisException(s"Cannot modify the value of a static config: $key")
157156
}
158-
if (sqlConf.setCommandRejectsSparkConfs && SparkConf.sparkConfEntries.containsKey(key)) {
157+
if (sqlConf.setCommandRejectsSparkConfs &&
158+
ConfigEntry.findEntry(key) != null && !SQLConf.sqlConfEntries.containsKey(key)) {
159159
throw new AnalysisException(s"Cannot modify the value of a spark config: $key")
160160
}
161161
}

0 commit comments

Comments
 (0)