use of org.apache.flink.table.catalog.exceptions.FunctionNotExistException in project flink by apache.
the class TableEnvironmentImpl method dropCatalogFunction.
private TableResultInternal dropCatalogFunction(DropCatalogFunctionOperation dropCatalogFunctionOperation) {
String exMsg = getDDLOpExecuteErrorMsg(dropCatalogFunctionOperation.asSummaryString());
try {
if (dropCatalogFunctionOperation.isTemporary()) {
functionCatalog.dropTempCatalogFunction(dropCatalogFunctionOperation.getFunctionIdentifier(), dropCatalogFunctionOperation.isIfExists());
} else {
Catalog catalog = getCatalogOrThrowException(dropCatalogFunctionOperation.getFunctionIdentifier().getCatalogName());
catalog.dropFunction(dropCatalogFunctionOperation.getFunctionIdentifier().toObjectPath(), dropCatalogFunctionOperation.isIfExists());
}
return TableResultImpl.TABLE_RESULT_OK;
} catch (ValidationException e) {
throw e;
} catch (FunctionNotExistException e) {
throw new ValidationException(e.getMessage(), e);
} catch (Exception e) {
throw new TableException(exMsg, e);
}
}
Aggregations