Skip to content

Commit

Permalink
Use ConfigEntry.findEntry().
Browse files Browse the repository at this point in the history
  • Loading branch information
ueshin committed Nov 15, 2018
1 parent 0320857 commit 37ebae4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import org.apache.spark.util.Utils

object SQLConf {

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

val staticConfKeys: java.util.Set[String] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

package org.apache.spark.sql

import org.apache.spark.SparkConf
import org.apache.spark.annotation.InterfaceStability
import org.apache.spark.internal.config.{ConfigEntry, OptionalConfigEntry}
import org.apache.spark.sql.internal.SQLConf
Expand Down Expand Up @@ -155,7 +154,8 @@ class RuntimeConfig private[sql](sqlConf: SQLConf = new SQLConf) {
if (SQLConf.staticConfKeys.contains(key)) {
throw new AnalysisException(s"Cannot modify the value of a static config: $key")
}
if (sqlConf.setCommandRejectsSparkConfs && SparkConf.sparkConfEntries.containsKey(key)) {
if (sqlConf.setCommandRejectsSparkConfs &&
ConfigEntry.findEntry(key) != null && !SQLConf.sqlConfEntries.containsKey(key)) {
throw new AnalysisException(s"Cannot modify the value of a spark config: $key")
}
}
Expand Down

0 comments on commit 37ebae4

Please sign in to comment.