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

Fix the bug in alter table set location.

    Details

    • Type: Bug
    • Status: In Progress
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 2.2.1
    • Fix Version/s: None
    • Component/s: SQL
    • Labels:
      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

              • Assignee:
                Unassigned
                Reporter:
                xubo245 xubo245
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: