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
Original file line number Diff line number Diff line change
Expand Up @@ -157,28 +157,28 @@ class SparkSessionBuilderSuite extends SparkFunSuite with BeforeAndAfterEach {
"spark context conf values in SessionState") {
val session = SparkSession.builder()
.master("local")
.config(GLOBAL_TEMP_DATABASE.key, value = "globalTempDB-SPARK-31234")
.config(GLOBAL_TEMP_DATABASE.key, value = "globaltempdb-spark-31234")
Copy link
Member

@dongjoon-hyun dongjoon-hyun Apr 25, 2020

Choose a reason for hiding this comment

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

Now, I understand why you change the conf. This one is the safest test case change in branch-2.4.

Copy link
Member Author

@maropu maropu Apr 25, 2020

Choose a reason for hiding this comment

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

Need this one? Dropping this is okay to me though.

.config("spark.app.name", "test-app-SPARK-31234")
.getOrCreate()

assert(session.sessionState.conf.getConfString("spark.app.name") === "test-app-SPARK-31234")
assert(session.sessionState.conf.getConf(GLOBAL_TEMP_DATABASE) === "globalTempDB-SPARK-31234")
assert(session.sessionState.conf.getConf(GLOBAL_TEMP_DATABASE) === "globaltempdb-spark-31234")
session.sql("RESET")
assert(session.sessionState.conf.getConfString("spark.app.name") === "test-app-SPARK-31234")
assert(session.sessionState.conf.getConf(GLOBAL_TEMP_DATABASE) === "globalTempDB-SPARK-31234")
assert(session.sessionState.conf.getConf(GLOBAL_TEMP_DATABASE) === "globaltempdb-spark-31234")
}

test("SPARK-31532: should not propagate static sql configs to the existing" +
" active/default SparkSession") {
val session = SparkSession.builder()
.master("local")
.config(GLOBAL_TEMP_DATABASE.key, value = "globalTempDB-SPARK-31532")
.config(GLOBAL_TEMP_DATABASE.key, value = "globaltempdb-spark-31532")
.config("spark.app.name", "test-app-SPARK-31532")
.getOrCreate()
// do not propagate static sql configs to the existing active session
val session1 = SparkSession
.builder()
.config(GLOBAL_TEMP_DATABASE.key, "globalTempDB-SPARK-31532-1")
.config(GLOBAL_TEMP_DATABASE.key, "globaltempdb-spark-31532-1")
.getOrCreate()
assert(session.conf.get(GLOBAL_TEMP_DATABASE) === "globaltempdb-spark-31532")
assert(session1.conf.get(GLOBAL_TEMP_DATABASE) === "globaltempdb-spark-31532")
Expand All @@ -188,7 +188,7 @@ class SparkSessionBuilderSuite extends SparkFunSuite with BeforeAndAfterEach {
val session2 = SparkSession
.builder()
.config(WAREHOUSE_PATH.key, "SPARK-31532-db")
.config(GLOBAL_TEMP_DATABASE.key, value = "globalTempDB-SPARK-31532-2")
.config(GLOBAL_TEMP_DATABASE.key, value = "globaltempdb-spark-31532-2")
.getOrCreate()

assert(!session.conf.get(WAREHOUSE_PATH).contains("SPARK-31532-db"))
Expand All @@ -207,7 +207,7 @@ class SparkSessionBuilderSuite extends SparkFunSuite with BeforeAndAfterEach {
// propagate static sql configs if no existing session
val session = SparkSession
.builder()
.config(GLOBAL_TEMP_DATABASE.key, "globalTempDB-SPARK-31532-2")
.config(GLOBAL_TEMP_DATABASE.key, "globaltempdb-spark-31532-2")
.config(WAREHOUSE_PATH.key, "SPARK-31532-db-2")
.getOrCreate()
assert(session.conf.get("spark.app.name") === "test-app-SPARK-31532-2")
Expand Down