nk1506 commented on code in PR #8907:
URL: https://github.com/apache/iceberg/pull/8907#discussion_r1380574090


##########
core/src/test/java/org/apache/iceberg/view/ViewCatalogTests.java:
##########
@@ -718,8 +743,16 @@ public void renameTableTargetAlreadyExistsAsView() {
     assertThat(catalog().viewExists(viewIdentifier)).as("View should 
exist").isTrue();
 
     assertThatThrownBy(() -> tableCatalog().renameTable(tableIdentifier, 
viewIdentifier))
-        .isInstanceOf(AlreadyExistsException.class)
-        .hasMessageContaining("Cannot rename ns.table to ns.view. View already 
exists");
+        .satisfiesAnyOf(
+            throwable ->
+                assertThat(throwable)
+                    .isInstanceOf(RuntimeException.class)
+                    .hasMessageContaining("new table ns.view already exists"),

Review Comment:
   It seems all the catalog is not following the same style of error message. 
   One example:
   
[InMemoryCatalog](https://github.com/apache/iceberg/blob/4a3d266a6946f00602cfddc809e5480f3139f352/core/src/main/java/org/apache/iceberg/inmemory/InMemoryCatalog.java#L148)
 has different error message in case of failed validation, while 
   
[HiveCatalog](https://github.com/apache/iceberg/blob/4a3d266a6946f00602cfddc809e5480f3139f352/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java#L224)
  might throw different error message. 
   Only way I can think of here is follow the same error message for all the 
Catalogs who us trying to use Catalog Level tests. Or add the or clause with 
applicable error message. 
   
   Please share your thoughts. 



##########
core/src/test/java/org/apache/iceberg/view/ViewCatalogTests.java:
##########
@@ -368,8 +368,19 @@ public void 
createTableViaTransactionThatAlreadyExistsAsView() {
     assertThat(catalog().viewExists(viewIdentifier)).as("View should 
exist").isTrue();
 
     assertThatThrownBy(transaction::commitTransaction)
-        .isInstanceOf(AlreadyExistsException.class)
-        .hasMessageStartingWith("View with same name already exists: ns.view");
+        .satisfiesAnyOf(

Review Comment:
   same as above. 



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to