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

Fix improper information of TempTableAlreadyExistsException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.2.1
    • 2.3.0
    • SQL
    • None

    Description

       

      Problem: it throw TempTableAlreadyExistsException and output "Temporary table '$table' already exists" when we create temp view by using org.apache.spark.sql.catalyst.catalog.GlobalTempViewManager#create, it's improper.

       /**
         * Creates a global temp view, or issue an exception if the view already exists and
         * `overrideIfExists` is false.
         */
        def create(
            name: String,
            viewDefinition: LogicalPlan,
            overrideIfExists: Boolean): Unit = synchronized {
          if (!overrideIfExists && viewDefinitions.contains(name)) {
            throw new TempTableAlreadyExistsException(name)
          }
          viewDefinitions.put(name, viewDefinition)
        }
      

      No need to fix:
      warning: TEMPORARY TABLE ... USING ... is deprecated and use TempViewAlreadyExistsException when create temp view
      There are warning when run test: test("rename temporary view - destination table with database name")

      02:11:38.136 WARN org.apache.spark.sql.execution.SparkSqlAstBuilder: CREATE TEMPORARY TABLE ... USING ... is deprecated, please use CREATE TEMPORARY VIEW ... USING ... instead
      other test cases also have this warning

      Attachments

        Activity

          People

            xubo245 Bo Xu
            xubo245 Bo Xu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: