Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-19055

SparkSession initialization will be associated with invalid SparkContext when new SparkContext is created to replace stopped SparkContext

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.3, 2.1.1, 2.2.0
    • PySpark, SQL
    • None

    Description

      In SparkSession initialization, we store created the instance of SparkSession into a class variable _instantiatedContext. Next time we can use SparkSession.builder.getOrCreate() to retrieve the existing SparkSession instance.

      However, when the active SparkContext is stopped and we create another new SparkContext to use, the existing SparkSession is still associated with the stopped SparkContext. So the operations with this existing SparkSession will be failed.

      We need to detect such case in SparkSession and renew the class variable _instantiatedContext if needed.

      Attachments

        Issue Links

          Activity

            People

              viirya L. C. Hsieh
              viirya L. C. Hsieh
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: