Search in sources :

Example 6 with FunctionNotExistException

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);
    }
}
Also used : FunctionNotExistException(org.apache.flink.table.catalog.exceptions.FunctionNotExistException) TableException(org.apache.flink.table.api.TableException) ValidationException(org.apache.flink.table.api.ValidationException) Catalog(org.apache.flink.table.catalog.Catalog) GenericInMemoryCatalog(org.apache.flink.table.catalog.GenericInMemoryCatalog) FunctionCatalog(org.apache.flink.table.catalog.FunctionCatalog) FunctionAlreadyExistException(org.apache.flink.table.catalog.exceptions.FunctionAlreadyExistException) DatabaseNotExistException(org.apache.flink.table.catalog.exceptions.DatabaseNotExistException) TableAlreadyExistException(org.apache.flink.table.catalog.exceptions.TableAlreadyExistException) TableException(org.apache.flink.table.api.TableException) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException) CatalogException(org.apache.flink.table.catalog.exceptions.CatalogException) FunctionNotExistException(org.apache.flink.table.catalog.exceptions.FunctionNotExistException) DatabaseNotEmptyException(org.apache.flink.table.catalog.exceptions.DatabaseNotEmptyException) DatabaseAlreadyExistException(org.apache.flink.table.catalog.exceptions.DatabaseAlreadyExistException) SqlParserException(org.apache.flink.table.api.SqlParserException) ValidationException(org.apache.flink.table.api.ValidationException) TableNotExistException(org.apache.flink.table.catalog.exceptions.TableNotExistException)

Aggregations

FunctionNotExistException (org.apache.flink.table.catalog.exceptions.FunctionNotExistException)6 CatalogException (org.apache.flink.table.catalog.exceptions.CatalogException)4 IOException (java.io.IOException)2 ExecutionException (java.util.concurrent.ExecutionException)2 SqlParserException (org.apache.flink.table.api.SqlParserException)2 TableException (org.apache.flink.table.api.TableException)2 ValidationException (org.apache.flink.table.api.ValidationException)2 Catalog (org.apache.flink.table.catalog.Catalog)2 CatalogFunction (org.apache.flink.table.catalog.CatalogFunction)2 FunctionCatalog (org.apache.flink.table.catalog.FunctionCatalog)2 GenericInMemoryCatalog (org.apache.flink.table.catalog.GenericInMemoryCatalog)2 DatabaseAlreadyExistException (org.apache.flink.table.catalog.exceptions.DatabaseAlreadyExistException)2 DatabaseNotEmptyException (org.apache.flink.table.catalog.exceptions.DatabaseNotEmptyException)2 DatabaseNotExistException (org.apache.flink.table.catalog.exceptions.DatabaseNotExistException)2 FunctionAlreadyExistException (org.apache.flink.table.catalog.exceptions.FunctionAlreadyExistException)2 TableAlreadyExistException (org.apache.flink.table.catalog.exceptions.TableAlreadyExistException)2 TableNotExistException (org.apache.flink.table.catalog.exceptions.TableNotExistException)2 CatalogFunctionImpl (org.apache.flink.table.catalog.CatalogFunctionImpl)1 AggregateFunctionDefinition (org.apache.flink.table.functions.AggregateFunctionDefinition)1 FunctionDefinition (org.apache.flink.table.functions.FunctionDefinition)1