Github user zsxwing commented on a diff in the pull request: https://github.com/apache/spark/pull/16826#discussion_r100198503 --- Diff: sql/core/src/test/scala/org/apache/spark/sql/SparkSessionBuilderSuite.scala --- @@ -123,4 +125,70 @@ class SparkSessionBuilderSuite extends SparkFunSuite { session.stop() } } + + test("fork new session and inherit a copy of the session state") { + val activeSession = SparkSession.builder().master("local").getOrCreate() + val forkedSession = activeSession.newSession(inheritSessionState = true) + + assert(forkedSession ne activeSession) + assert(forkedSession.sessionState ne activeSession.sessionState) + + forkedSession.stop() + activeSession.stop() + } + + test("fork new session and inherit sql config options") { + val activeSession = SparkSession + .builder() + .master("local") + .config("spark-configb", "b") --- End diff -- This is in the shared state. You should use `SparkSession.conf.set` instead.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org