cloud-fan commented on a change in pull request #26539: [SPARK-29728][SQL] 
Datasource V2: Support ALTER TABLE RENAME TO
URL: https://github.com/apache/spark/pull/26539#discussion_r346681398
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveCatalogs.scala
 ##########
 @@ -93,6 +93,22 @@ class ResolveCatalogs(val catalogManager: CatalogManager)
         s"Can not specify catalog `${catalog.name}` for view 
${tableName.quoted} " +
           s"because view support in catalog has not been implemented yet")
 
+    case RenameTableStatement(NonSessionCatalog(catalog, oldName), 
newNameParts, isView) =>
+      if (isView) {
+        throw new AnalysisException("Renaming view is not supported in v2 
catalogs.")
+      }
+      newNameParts match {
+        case NonSessionCatalog(newCatalog, newName) =>
 
 Review comment:
   If there is a name conflict, this forces users to always specify the catalog 
name.
   
   I think it's easier to define the `newNameParts` as the identifier of the 
target catalog, so that we can just return
   `RenameTable(atalog.asTableCatalog, oldName.asIdentifier, 
newNameParts.asIdentifier)`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to