Github user cloud-fan commented on a diff in the pull request:
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala ---
    @@ -665,15 +665,7 @@ case class AlterTableSetLocationCommand(
             catalog.alterPartitions(tableName, Seq(newPart))
           case None =>
             // No partition spec is specified, so we set the location for the 
table itself
    -        val newTable =
    -          if (DDLUtils.isDatasourceTable(table)) {
    -            table.withNewStorage(
    -              locationUri = Some(location),
    -              properties = ++ Map("path" -> 
    -          } else {
    -            table.withNewStorage(locationUri = Some(location))
    -          }
    -        catalog.alterTable(newTable)
    +        catalog.alterTable(table.withNewStorage(locationUri = 
    --- End diff --
    FYI we have a bug here, currently we allow users to `SET LOCATION` for 
managed data source table, however, in `SHOW CREATE TABLE`, we can't generate 
corrected SQL to create managed data source table whose location has been set, 
because data source with path is always treated as external table. We should 
either forbid `SET LOCATION` for managed data source table, or improve the 
CREATE TABLE syntax to support managed table with path.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to