Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions sql/core/src/main/scala/org/apache/spark/sql/SQLConf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ import scala.collection.JavaConverters._
* SQLConf holds mutable config parameters and hints. These can be set and
* queried either by passing SET commands into Spark SQL's DSL
* functions (sql(), hql(), etc.), or by programmatically using setters and
* getters of this class. This class is thread-safe.
* getters of this class.
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps remove the last sentence of the first paragraph

* SQLConf is thread-safe (internally synchronized so safe to be used in multiple threads).
*/
trait SQLConf {

Expand Down Expand Up @@ -71,11 +73,9 @@ trait SQLConf {
Option(settings.get(key)).getOrElse(defaultValue)
}

def getAll: Array[(String, String)] = settings.asScala.toArray
def getAll: Array[(String, String)] = settings.synchronized { settings.asScala.toArray }

def getOption(key: String): Option[String] = {
Option(settings.get(key))
}
def getOption(key: String): Option[String] = Option(settings.get(key))

def contains(key: String): Boolean = settings.containsKey(key)

Expand Down