Skip to content

Commit a7bcb98

Browse files
committed
use ConcurrentHashMap in sql conf, intead synchronizedMap
1 parent 2fc8aca commit a7bcb98

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ private[spark] object SQLConf {
5050
trait SQLConf {
5151
import SQLConf._
5252

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

5656
/** ************************ Spark SQL Params/Hints ******************* */
5757
// TODO: refactor so that these hints accessors don't pollute the name space of SQLContext?

sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ class HiveQuerySuite extends HiveComparisonTest {
473473

474474
sql(s"SET ${testKey + testKey}=${testVal + testVal}")
475475
assert(hiveconf.get(testKey + testKey, "") == testVal + testVal)
476-
assertResult(Array(s"$testKey=$testVal", s"${testKey + testKey}=${testVal + testVal}")) {
476+
assertResult(Array( s"${testKey + testKey}=${testVal + testVal}", s"$testKey=$testVal")) {
477477
sql(s"SET").collect().map(_.getString(0))
478478
}
479479

@@ -501,7 +501,7 @@ class HiveQuerySuite extends HiveComparisonTest {
501501

502502
sql(s"SET ${testKey + testKey}=${testVal + testVal}")
503503
assert(hiveconf.get(testKey + testKey, "") == testVal + testVal)
504-
assertResult(Array(s"$testKey=$testVal", s"${testKey + testKey}=${testVal + testVal}")) {
504+
assertResult(Array(s"${testKey + testKey}=${testVal + testVal}", s"$testKey=$testVal")) {
505505
sql("SET").collect().map(_.getString(0))
506506
}
507507

0 commit comments

Comments
 (0)