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

RESET can clear StaticSQLConfs

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 3.0.1
    • 3.1.0
    • SQL
    • None

    Description

      The RESET command can clear a sessions' static SQL configurations, when that static SQL configuration was set on a SparkSession that uses a pre-existing SparkContext. Here is repro:

      // Blow away any pre-existing session thread locals
      org.apache.spark.sql.SparkSession.clearDefaultSession()
      org.apache.spark.sql.SparkSession.clearActiveSession()
      
      // Create new session and explicitly set a spark context
      val newSession = org.apache.spark.sql.SparkSession.builder
       .sparkContext(sc)
       .config("spark.sql.globalTempDatabase", "bob")
       .getOrCreate()
      assert(newSession.conf.get("spark.sql.globalTempDatabase") == "bob")
      newSession.sql("reset")
      assert(newSession.conf.get("spark.sql.globalTempDatabase") == "bob") // Boom!
      

      The problem is that RESET assumes it can use the SparkContext's configurations as its default.

       

       

      Attachments

        Issue Links

          Activity

            People

              Qin Yao Kent Yao 2
              hvanhovell Herman van Hövell
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: