Skip to content

Commit

Permalink
fix error change in RESTCatalog
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry-024 committed Dec 13, 2024
1 parent fdd386c commit 3e184ab
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.apache.paimon.rest;

import java.util.ArrayList;
import org.apache.paimon.catalog.Catalog;
import org.apache.paimon.catalog.Database;
import org.apache.paimon.catalog.DatabaseChange;
Expand Down Expand Up @@ -167,9 +168,12 @@ public Database getDatabase(String name) throws DatabaseNotExistException {
public void dropDatabase(String name, boolean ignoreIfNotExists, boolean cascade)
throws DatabaseNotExistException, DatabaseNotEmptyException {
try {
if (!cascade && !this.listTables(name).isEmpty()) {
throw new DatabaseNotEmptyException(name);
}
client.delete(resourcePaths.database(name), headers());
} catch (NoSuchResourceException e) {
if(!ignoreIfNotExists) {
if (!ignoreIfNotExists) {
throw new DatabaseNotExistException(name);
}
}
Expand Down Expand Up @@ -220,7 +224,7 @@ public Path getTableLocation(Identifier identifier) {

@Override
public List<String> listTables(String databaseName) throws DatabaseNotExistException {
throw new UnsupportedOperationException();
return new ArrayList<String>();
}

@Override
Expand Down

0 comments on commit 3e184ab

Please sign in to comment.