Github user jerryshao commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20404#discussion_r164108216
  
    --- Diff: python/pyspark/sql/session.py ---
    @@ -225,6 +225,7 @@ def __init__(self, sparkContext, jsparkSession=None):
             if SparkSession._instantiatedSession is None \
                     or SparkSession._instantiatedSession._sc._jsc is None:
                 SparkSession._instantiatedSession = self
    +            
self._jvm.org.apache.spark.sql.SparkSession.setDefaultSession(self._jsparkSession)
    --- End diff --
    
    >Btw, shall we clear it when stopping PySpark SparkSession?
    
    JVM SparkSession will clear it when application is stopped 
(https://github.com/apache/spark/blob/3e252514741447004f3c18ddd77c617b4e37cfaa/sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala#L961).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to