davseitsev commented on code in PR #12892:
URL: https://github.com/apache/iceberg/pull/12892#discussion_r2768398870


##########
core/src/test/java/org/apache/iceberg/catalog/CatalogTests.java:
##########
@@ -1025,6 +1027,86 @@ public void testRenameTable() {
     assertEmpty("Should not contain table after drop", catalog, NS);
   }
 
+  @Test
+  public void createTableInUniqueLocation() {
+    Map<String, String> additionalProperties =
+        ImmutableMap.of(CatalogProperties.UNIQUE_TABLE_LOCATION, "true");
+    C catalog = initCatalog("uniq_path_catalog", additionalProperties);
+
+    if (requiresNamespaceCreate()) {
+      catalog.createNamespace(NS);
+    }
+
+    catalog.createTable(TABLE, SCHEMA, PartitionSpec.unpartitioned());
+    catalog.renameTable(TABLE, RENAMED_TABLE);
+    catalog.createTable(TABLE, SCHEMA, PartitionSpec.unpartitioned());
+
+    Table table = catalog.loadTable(TABLE);
+    Table renamedTable = catalog.loadTable(RENAMED_TABLE);
+
+    assertThat(table.location())
+        .as("Tables %s and %s have different location", TABLE, RENAMED_TABLE)
+        .isNotEqualTo(renamedTable.location());
+  }
+
+  @Test
+  public void dropAfterRenameDoesntCorruptTable() throws IOException {

Review Comment:
   It doesn't fail for existing catalogs - I'm not expecting it to. The intent 
is to add a regression/guardrail so we catch this class of issue when a new 
catalog is added (or an existing one changes) and would otherwise slip through.
   That said, if people feel it's redundant/noisy here, I'm fine removing it.



-- 
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]

Reply via email to