This is an automated email from the ASF dual-hosted git repository.
pvary pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git
The following commit(s) were added to refs/heads/main by this push:
new 0c6bbea665 Nessie: Return false for table and view drop type
mismatches (#18912)
0c6bbea665 is described below
commit 0c6bbea6656156a503a8603736753fa590d79c99
Author: Daksh Dave <[email protected]>
AuthorDate: Mon Nov 23 01:23:07 2026 -0800
Nessie: Return false for table and view drop type mismatches (#18912)
---
.../org/apache/iceberg/nessie/NessieIcebergClient.java | 9 +--------
.../apache/iceberg/nessie/TestNessieViewCatalog.java | 18 ------------------
2 files changed, 1 insertion(+), 26 deletions(-)
diff --git
a/nessie/src/main/java/org/apache/iceberg/nessie/NessieIcebergClient.java
b/nessie/src/main/java/org/apache/iceberg/nessie/NessieIcebergClient.java
index 9616855a71..dc6e80acd4 100644
--- a/nessie/src/main/java/org/apache/iceberg/nessie/NessieIcebergClient.java
+++ b/nessie/src/main/java/org/apache/iceberg/nessie/NessieIcebergClient.java
@@ -551,17 +551,10 @@ public class NessieIcebergClient implements AutoCloseable
{
getRef().checkMutable();
IcebergContent existingContent = fetchContent(identifier);
- if (existingContent == null) {
+ if (existingContent == null || existingContent.getType() != type) {
return false;
}
- if (existingContent.getType() != type) {
- throw new RuntimeException(
- String.format(
- "Cannot drop %s: not matching with the type `%s`",
- identifier, NessieUtil.contentTypeString(type)));
- }
-
String contentType =
NessieUtil.contentTypeString(type).toLowerCase(Locale.ROOT);
if (purge) {
diff --git
a/nessie/src/test/java/org/apache/iceberg/nessie/TestNessieViewCatalog.java
b/nessie/src/test/java/org/apache/iceberg/nessie/TestNessieViewCatalog.java
index 3ed3442013..dc3d5dc0ed 100644
--- a/nessie/src/test/java/org/apache/iceberg/nessie/TestNessieViewCatalog.java
+++ b/nessie/src/test/java/org/apache/iceberg/nessie/TestNessieViewCatalog.java
@@ -35,13 +35,10 @@ import org.apache.iceberg.view.ViewCatalogTests;
import org.apache.iceberg.view.ViewMetadata;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.api.io.TempDir;
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.ValueSource;
import org.projectnessie.client.api.NessieApiV1;
import org.projectnessie.client.ext.NessieApiVersion;
import org.projectnessie.client.ext.NessieApiVersions;
@@ -104,21 +101,6 @@ public class TestNessieViewCatalog extends
ViewCatalogTests<NessieCatalog> {
}
}
- @Override
- @Disabled("Pending https://github.com/apache/iceberg/pull/18912")
- @ParameterizedTest(name = "purge = {0}")
- @ValueSource(booleans = {false, true})
- public void dropTableThatAlreadyExistsAsView(boolean purge) {
- super.dropTableThatAlreadyExistsAsView(purge);
- }
-
- @Override
- @Disabled("Pending https://github.com/apache/iceberg/pull/18912")
- @Test
- public void dropViewThatAlreadyExistsAsTable() {
- super.dropViewThatAlreadyExistsAsTable();
- }
-
private void resetData() throws NessieConflictException,
NessieNotFoundException {
Branch defaultBranch = api.getDefaultBranch();
for (Reference r : api.getAllReferences().get().getReferences()) {