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

Fix the bug in alter table set location.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Won't Fix
    • 2.2.1
    • None
    • SQL
    • None

    Description

      TOBO work: Fix the bug in alter table set location.
      org.apache.spark.sql.execution.command.DDLSuite#testSetLocation

          // TODO(gatorsmile): fix the bug in alter table set location.
         //    if (isUsingHiveMetastore) {
          //    assert(storageFormat.properties.get("path") === expected)
          //   }
      

      Analysis:

      because user add locationUri and erase path by

       newPath = None
      

      in org.apache.spark.sql.hive.HiveExternalCatalog#restoreDataSourceTable:

      val storageWithLocation = {
            val tableLocation = getLocationFromStorageProps(table)
            // We pass None as `newPath` here, to remove the path option in storage properties.
            updateLocationInStorageProps(table, newPath = None).copy(
              locationUri = tableLocation.map(CatalogUtils.stringToURI(_)))
          }
      

      =>
      newPath = None

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: