File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
sql/core/src/main/scala/org/apache/spark/sql Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -529,8 +529,8 @@ private[sql] class SQLConf extends Serializable with CatalystConf {
529529 def getConfString (key : String ): String = {
530530 Option (settings.get(key)).
531531 orElse {
532- // Try to use the default value
533- Option (sqlConfEntries.get(key)).map(_.defaultValueString)
532+ // Try to use the default value
533+ Option (sqlConfEntries.get(key)).map(_.defaultValueString)
534534 }.
535535 getOrElse(throw new NoSuchElementException (key))
536536 }
@@ -584,11 +584,15 @@ private[sql] class SQLConf extends Serializable with CatalystConf {
584584 }.toSeq
585585 }
586586
587- private [spark] def unsetConf (key : String ) {
587+ private [spark] def unsetConf (key : String ): Unit = {
588588 settings -= key
589589 }
590590
591- private [spark] def clear () {
591+ private [spark] def unsetConf (entry : SQLConfEntry [_]): Unit = {
592+ settings -= entry.key
593+ }
594+
595+ private [spark] def clear (): Unit = {
592596 settings.clear()
593597 }
594598}
Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ class SQLContext(@transient val sparkContext: SparkContext)
155155 // SET spark.sql.dialect=sql; Let's reset as default dialect automatically.
156156 val dialect = conf.dialect
157157 // reset the sql dialect
158- conf.unsetConf(SQLConf .DIALECT .key )
158+ conf.unsetConf(SQLConf .DIALECT )
159159 // throw out the exception, and the default sql dialect will take effect for next query.
160160 throw new DialectException (
161161 s """ Instantiating dialect ' $dialect' failed.
You can’t perform that action at this time.
0 commit comments