HyukjinKwon commented on code in PR #42367:
URL: https://github.com/apache/spark/pull/42367#discussion_r1285345765
##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -811,30 +842,79 @@ object SparkSession extends Logging {
* If a session exist with the same configuration that is returned instead
of creating a new
* session.
*
+ * This method will update the default and/or active session if they are
not set.
+ *
* @since 3.5.0
*/
def getOrCreate(): SparkSession = {
-
tryCreateSessionFromClient().getOrElse(sessions.get(builder.configuration))
+ val session = tryCreateSessionFromClient()
+ .getOrElse(sessions.get(builder.configuration))
+ setDefaultAndActiveSession(session)
+ session
Review Comment:
qq shouldn't we return the active session here? Seems like it will always
return the newly created one, and sets the active session if not set.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]