diff --git a/ice-rest-catalog/pom.xml b/ice-rest-catalog/pom.xml index 43a8121e..fda0550b 100644 --- a/ice-rest-catalog/pom.xml +++ b/ice-rest-catalog/pom.xml @@ -393,7 +393,6 @@ com.fasterxml.jackson.dataformat jackson-dataformat-yaml ${jackson.version} - test io.etcd diff --git a/ice-rest-catalog/src/main/java/com/altinity/ice/rest/catalog/internal/etcd/EtcdCatalog.java b/ice-rest-catalog/src/main/java/com/altinity/ice/rest/catalog/internal/etcd/EtcdCatalog.java index 6d76830e..9d89be9e 100644 --- a/ice-rest-catalog/src/main/java/com/altinity/ice/rest/catalog/internal/etcd/EtcdCatalog.java +++ b/ice-rest-catalog/src/main/java/com/altinity/ice/rest/catalog/internal/etcd/EtcdCatalog.java @@ -203,7 +203,6 @@ private void validateTableIdentifier(TableIdentifier identifier) { @Override public List listNamespaces(Namespace namespace) throws NoSuchNamespaceException { - validateNamespace(namespace); String prefix = namespaceKey(namespace); prefix = prefix.endsWith("/") ? prefix : prefix + "/"; GetResponse res = unwrap(kv.get(byteSeq(prefix), GetOption.builder().isPrefix(true).build())); @@ -241,11 +240,11 @@ private KeyValue loadNamespaceMetadataRaw(Namespace namespace) throws NoSuchName @Override public boolean dropNamespace(Namespace namespace) throws NamespaceNotEmptyException { - validateNamespace(namespace); if (!namespaceExists(namespace)) { throw new NoSuchNamespaceException("Namespace does not exist: %s", namespace); } - if (!listNamespaces(namespace).isEmpty() || !listTables(namespace).isEmpty()) { + if (!namespace.level(0).isEmpty() + && (!listNamespaces(namespace).isEmpty() || !listTables(namespace).isEmpty())) { throw new NamespaceNotEmptyException("Cannot drop non-empty namespace: " + namespace); } // FIXME: child ns/table might have been created since check ^ @@ -336,7 +335,6 @@ protected TableOperations newTableOps(TableIdentifier tableIdentifier) { @Override public List listTables(Namespace namespace) { - validateNamespace(namespace); String prefix = tableKey(namespace); prefix = prefix.endsWith("/") ? prefix : prefix + "/"; GetResponse res = unwrap(kv.get(byteSeq(prefix), GetOption.builder().isPrefix(true).build()));