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

Using HiveContext after re-creating SparkContext in Spark 2.0 throws "Java.lang.illegalStateException: Cannot call methods on a stopped sparkContext"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.1, 2.1.0
    • PySpark
    • None
    • Amazon AWS EMR 5.0

    Description

      After stopping SparkSession if we recreate it and use HiveContext in it. it will throw error.

      Steps to reproduce:
      spark = SparkSession.builder.enableHiveSupport().getOrCreate()
      spark.sql("show databases")
      spark.stop()
      spark = SparkSession.builder.enableHiveSupport().getOrCreate()
      spark.sql("show databases")

      "Java.lang.illegalStateException: Cannot call methods on a stopped sparkContext"

      Above error occurs only in case of Pyspark not in SparkShell

      Attachments

        Activity

          People

            zjffdu Jeff Zhang
            rahuljain788 Rahul Jain
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: