Skip to content

Commit

Permalink
Handle comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ajantha-bhat committed Dec 11, 2023
1 parent 589e428 commit 5981bad
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Expand Up @@ -241,7 +241,7 @@ public boolean dropTable(TableIdentifier identifier, boolean purge) {
TableReference tableReference = parseTableReference(identifier);
return client
.withReference(tableReference.getReference(), tableReference.getHash())
.dropTable(identifierWithoutTableReference(identifier, tableReference), false);
.dropTable(identifierWithoutTableReference(identifier, tableReference), purge);
}

@Override
Expand Down
Expand Up @@ -546,7 +546,7 @@ private boolean dropContent(TableIdentifier identifier, boolean purge, Content.T
// We try to drop the content. Simple retry after ref update.
try {
commitRetry(
String.format("Iceberg delete table %s", identifier),
String.format("Iceberg delete %s %s", contentType, identifier),
Operation.Delete.of(NessieUtil.toKey(identifier)));
return true;
} catch (NessieConflictException e) {
Expand Down
Expand Up @@ -248,6 +248,7 @@ static Optional<RuntimeException> handleExceptionsForCommits(
// safe than sorry.
return Optional.of(new CommitStateUnknownException(exception));
}

return Optional.empty();
}

Expand All @@ -274,6 +275,7 @@ static Optional<RuntimeException> handleBadRequestForCommit(
} catch (NessieNotFoundException e) {
return Optional.of(new RuntimeException(e));
}

return Optional.empty();
}

Expand Down Expand Up @@ -325,6 +327,7 @@ static String contentTypeString(Content.Type type) {
} else if (type.equals(Content.Type.NAMESPACE)) {
return "Namespace";
}

throw new IllegalArgumentException("Unsupported Nessie content type " + type.name());
}
}
Expand Up @@ -102,6 +102,7 @@ public void doCommit(ViewMetadata base, ViewMetadata metadata) {
if (ex instanceof NessieConflictException || ex instanceof NessieNotFoundException) {
failure = true;
}

NessieUtil.handleExceptionsForCommits(ex, client.refName(), Content.Type.ICEBERG_VIEW)
.ifPresent(
exception -> {
Expand Down

0 comments on commit 5981bad

Please sign in to comment.