mgaido91 commented on a change in pull request #25206: [SPARK-28265][SQL] Add renameTable to TableCatalog API URL: https://github.com/apache/spark/pull/25206#discussion_r305574650
########## File path: sql/catalyst/src/main/java/org/apache/spark/sql/catalog/v2/TableCatalog.java ########## @@ -134,4 +134,24 @@ Table alterTable( * @return true if a table was deleted, false if no table exists for the identifier */ boolean dropTable(Identifier ident); + + /** + * Rename a table in the catalog. + * <p> + * If the catalog supports views and contains a view for the old identifier and not a table, this + * must throw {@link NoSuchTableException}. Additionally, if the new identifier is a table + * or a view, this must throw {@link TableAlreadyExistsException}. + * <p> + * If the catalog does not support table renames between namespaces, it must + * throw {@link UnsupportedOperationException}. + * + * @param oldIdent the table identifier of the existing table to rename + * @param newIdent the new table identifier of the table + * @throws NoSuchTableException If the table to rename doesn't exist or is a view + * @throws TableAlreadyExistsException If the new table name already exists or is a view + * @throws UnsupportedOperationException If the namespaces of old and new identiers do not + * match (optional) + */ + void renameTable(Identifier oldIdent, Review comment: ``` void renameTable(Identifier oldIdent, Identifier newIdent) throws NoSuchTableException, TableAlreadyExistsException; } ``` ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org