Skip to content

Commit

Permalink
use ConcurrentHashMap in sql conf, intead synchronizedMap
Browse files Browse the repository at this point in the history
  • Loading branch information
scwf committed Aug 17, 2014
1 parent 2fc8aca commit a7bcb98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sql/core/src/main/scala/org/apache/spark/sql/SQLConf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ private[spark] object SQLConf {
trait SQLConf {
import SQLConf._

@transient protected[spark] val settings = java.util.Collections.synchronizedMap(
new java.util.HashMap[String, String]())
@transient protected[spark] val settings =
new java.util.concurrent.ConcurrentHashMap[String, String]

/** ************************ Spark SQL Params/Hints ******************* */
// TODO: refactor so that these hints accessors don't pollute the name space of SQLContext?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ class HiveQuerySuite extends HiveComparisonTest {

sql(s"SET ${testKey + testKey}=${testVal + testVal}")
assert(hiveconf.get(testKey + testKey, "") == testVal + testVal)
assertResult(Array(s"$testKey=$testVal", s"${testKey + testKey}=${testVal + testVal}")) {
assertResult(Array( s"${testKey + testKey}=${testVal + testVal}", s"$testKey=$testVal")) {
sql(s"SET").collect().map(_.getString(0))
}

Expand Down Expand Up @@ -501,7 +501,7 @@ class HiveQuerySuite extends HiveComparisonTest {

sql(s"SET ${testKey + testKey}=${testVal + testVal}")
assert(hiveconf.get(testKey + testKey, "") == testVal + testVal)
assertResult(Array(s"$testKey=$testVal", s"${testKey + testKey}=${testVal + testVal}")) {
assertResult(Array(s"${testKey + testKey}=${testVal + testVal}", s"$testKey=$testVal")) {
sql("SET").collect().map(_.getString(0))
}

Expand Down

0 comments on commit a7bcb98

Please sign in to comment.