diff --git a/paimon-core/src/main/java/org/apache/paimon/rest/RESTCatalog.java b/paimon-core/src/main/java/org/apache/paimon/rest/RESTCatalog.java index a452b86dfd8a..5a59a43cc263 100644 --- a/paimon-core/src/main/java/org/apache/paimon/rest/RESTCatalog.java +++ b/paimon-core/src/main/java/org/apache/paimon/rest/RESTCatalog.java @@ -34,7 +34,6 @@ import org.apache.paimon.rest.exceptions.NoSuchResourceException; import org.apache.paimon.rest.requests.AlertDatabaseRequest; import org.apache.paimon.rest.requests.CreateDatabaseRequest; -import org.apache.paimon.rest.requests.DropDatabaseRequest; import org.apache.paimon.rest.responses.AlertDatabaseResponse; import org.apache.paimon.rest.responses.ConfigResponse; import org.apache.paimon.rest.responses.CreateDatabaseResponse; @@ -167,11 +166,12 @@ public Database getDatabase(String name) throws DatabaseNotExistException { @Override public void dropDatabase(String name, boolean ignoreIfNotExists, boolean cascade) throws DatabaseNotExistException, DatabaseNotEmptyException { - DropDatabaseRequest request = new DropDatabaseRequest(ignoreIfNotExists, cascade); try { - client.delete(resourcePaths.database(name), request, headers()); + client.delete(resourcePaths.database(name), headers()); } catch (NoSuchResourceException e) { - throw new DatabaseNotExistException(name); + if(!ignoreIfNotExists) { + throw new DatabaseNotExistException(name); + } } }