shenzhu commented on a change in pull request #17788:
URL: https://github.com/apache/flink/pull/17788#discussion_r748995473
##########
File path:
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/Catalog.java
##########
@@ -520,6 +520,20 @@ void alterFunction(
void dropFunction(ObjectPath functionPath, boolean ignoreIfNotExists)
throws FunctionNotExistException, CatalogException;
+ /**
+ * Rename an existing function.
+ *
+ * @param functionPath path of the function to be renamed
+ * @param newFunctionName the new name of the function
+ * @param ignoreIfNotExists flag to specify behavior if the function does
not exist: if set to
+ * false, throw an exception if set to true, nothing happens
+ * @throws FunctionNotExistException if the function does not exists
+ * @throws FunctionAlreadyExistException if the function with
newFunctionName already exists
+ * @throws CatalogException in case of any runtime exception
+ */
+ void renameFunction(ObjectPath functionPath, String newFunctionName,
boolean ignoreIfNotExists)
Review comment:
> This is a breaking change. We should avoid this by default
implementing the new method to throw an exception instead.
Hey Airblader, thanks for your review!
`renameFunction` is a new API, and I added implementations to all classes
that implement this interface, including
[GenericInMemoryCatalog](https://github.com/apache/flink/pull/17788/files/11d9df98c5aa923f807d0664309dac4bd1c90f04#diff-84d3ac3214cf41bd86a1c357f9d843fcb1543ad5c5ad6f70b796c889baf2e98eR441),
[AbstractJdbcCatalog](https://github.com/apache/flink/pull/17788/files/11d9df98c5aa923f807d0664309dac4bd1c90f04#diff-fc58b969b72f23539ba2092d6566d9fe80c906fc133edac225ef6e76e2598849R328),
[HiveCatalog](https://github.com/apache/flink/pull/17788/files/11d9df98c5aa923f807d0664309dac4bd1c90f04#diff-a148c1339cd32d6c87ff5b879f076fbfc2c83eea67bd15fd78559b8833f4f2c3R1289)
and
[TestCatalog](https://github.com/apache/flink/pull/17788/files/11d9df98c5aa923f807d0664309dac4bd1c90f04#diff-a148c1339cd32d6c87ff5b879f076fbfc2c83eea67bd15fd78559b8833f4f2c3R1289),
it shouldn't break existing code. Do you mean add a default implementation in
interface like this?
```
default void renameFunction(ObjectPath functionPath, String newFunctionName,
boolean ignoreIfNotExists) throws FunctionNotExistException,
FunctionAlreadyExistException, CatalogException {
throw new UnsupportedOperationException();
}
```
Thanks for your time:)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]