Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20886#discussion_r178470264
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
 ---
    @@ -298,15 +302,28 @@ class SessionCatalog(
             makeQualifiedPath(tableDefinition.storage.locationUri.get)
           tableDefinition.copy(
             storage = tableDefinition.storage.copy(locationUri = 
Some(qualifiedTableLocation)),
    -        identifier = TableIdentifier(table, Some(db)))
    +        identifier = tableIdentifier)
         } else {
    -      tableDefinition.copy(identifier = TableIdentifier(table, Some(db)))
    +      tableDefinition.copy(identifier = tableIdentifier)
         }
     
         requireDbExists(db)
         externalCatalog.createTable(newTableDefinition, ignoreIfExists)
       }
     
    +  def validateTableLocation(table: CatalogTable, tableIdentifier: 
TableIdentifier): Unit = {
    +    // SPARK-19724: the default location of a managed table should be 
non-existent or empty.
    +   if (table.tableType == CatalogTableType.MANAGED) {
    +     val tableLocation = new Path(defaultTablePath(tableIdentifier))
    --- End diff --
    
    We always check `defaultTablePath `? Is that possible, the table location 
points to the different location?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to