nastra commented on code in PR #15051:
URL: https://github.com/apache/iceberg/pull/15051#discussion_r2694197322
##########
core/src/main/java/org/apache/iceberg/rest/RESTTableOperations.java:
##########
@@ -169,7 +169,7 @@ public void commit(TableMetadata base, TableMetadata
metadata) {
.addAll(metadata.changes())
.build();
requirements = UpdateRequirements.forCreateTable(updates);
- errorHandler = ErrorHandlers.tableErrorHandler(); // throws
NoSuchTableException
+ errorHandler = ErrorHandlers.tableCommitHandler(); // throws
NoSuchTableException
Review Comment:
on a first glance this seems correct to me but you'll most likely also need
to update
```
diff --git a/core/src/test/java/org/apache/iceberg/catalog/CatalogTests.java
b/core/src/test/java/org/apache/iceberg/catalog/CatalogTests.java
index c2fd24856f..057a889bec 100644
--- a/core/src/test/java/org/apache/iceberg/catalog/CatalogTests.java
+++ b/core/src/test/java/org/apache/iceberg/catalog/CatalogTests.java
@@ -2182,8 +2182,10 @@ public abstract class CatalogTests<C extends Catalog
& SupportsNamespaces> {
supportsServerSideRetry()
? "Requirement failed: table already exists"
: "Table already exists";
+ Class<? extends RuntimeException> expectedException =
+ supportsServerSideRetry() ? AlreadyExistsException.class :
CommitFailedException.class;
assertThatThrownBy(create::commitTransaction)
- .isInstanceOf(AlreadyExistsException.class)
+ .isInstanceOf(expectedException)
.hasMessageStartingWith(expectedMessage);
// validate the concurrently created table is unmodified
@@ -2434,8 +2436,10 @@ public abstract class CatalogTests<C extends Catalog
& SupportsNamespaces> {
supportsServerSideRetry()
? "Requirement failed: table already exists"
: "Table already exists";
+ Class<? extends RuntimeException> expectedException =
+ supportsServerSideRetry() ? AlreadyExistsException.class :
CommitFailedException.class;
assertThatThrownBy(createOrReplace::commitTransaction)
- .isInstanceOf(AlreadyExistsException.class)
+ .isInstanceOf(expectedException)
.hasMessageStartingWith(expectedMessage);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]