maropu commented on a change in pull request #24189:
[SPARK-27253][SQL]SparkSession clone discards SQLConf overrides in favor of
SparkConf defaults
URL: https://github.com/apache/spark/pull/24189#discussion_r269800441
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/SessionStateSuite.scala
##########
@@ -219,4 +222,23 @@ class SessionStateSuite extends SparkFunSuite {
val forkedSession = activeSession.cloneSession()
assert(activeSession.sharedState eq forkedSession.sharedState)
}
+
+ test("SPARK-27253 forked session should not discards SQLConf overrides " +
+ "in favor of SparkConf defaults") {
+ val key = "default-config"
+ try {
+ // override default config
+ activeSession.conf.set(key, "active")
+
+ val forkedSession = activeSession.cloneSession()
+ assert(forkedSession ne activeSession)
+ assert(forkedSession.conf ne activeSession.conf)
+
+ // forked session should not discard overridden SqlConf
+ assert(forkedSession.conf.get(key) == "active")
+ } finally {
+ activeSession.conf.unset(key)
+ }
+ }
+
Review comment:
nit: remove this blank line
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]