shenzhu commented on a change in pull request #17831:
URL: https://github.com/apache/flink/pull/17831#discussion_r754697190



##########
File path: 
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
##########
@@ -206,6 +206,22 @@ void dropDatabase(String name, boolean ignoreIfNotExists, 
boolean cascade)
     void alterDatabase(String name, CatalogDatabase newDatabase, boolean 
ignoreIfNotExists)
             throws DatabaseNotExistException, CatalogException;
 
+    /**
+     * Rename an existing database.
+     *
+     * @param name name of the database to be renamed
+     * @param newDatabaseName new name of the database
+     * @param ignoreIfNotExists flag to specify behavior when database does 
not exist: if set to
+     *     false, throw an exception, if set to true, do nothing
+     * @throws DatabaseNotExistException if the database does not exist
+     * @throws DatabaseAlreadyExistException if the database with 
newDatabaseName already exists
+     * @throws CatalogException in case of any runtime exception

Review comment:
       Hi @snuyanzin , thanks for your review!
   I saw 
[renameTable](https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java#L271)
 follows the same pattern for description, cause in its implementation it calls 
`checkArgument` which could potentially throw 
`java.lang.IllegalArgumentException`.
   Do you think we should update the function signature to something like this?
   ```
       /**
        * Rename an existing table or view.
        *
        * @param tablePath Path of the table or view to be renamed
        * @param newTableName the new name of the table or view
        * @param ignoreIfNotExists Flag to specify behavior when the table or 
view does not exist: if
        *     set to false, throw an exception, if set to true, do nothing.
        * @throws TableNotExistException if the table does not exist
        * @throws IllegalArgumentException when provided argument is not valid
        * @throws CatalogException in case of any other runtime exception
        */
       void renameTable(ObjectPath tablePath, String newTableName, boolean 
ignoreIfNotExists)
               throws TableNotExistException, TableAlreadyExistException, 
IllegalArgumentException, CatalogException;
   ```




-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to