You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/05/30 12:56:44 UTC

[GitHub] [iceberg] nastra commented on a diff in pull request #4826: Nessie: Use unique path for different table with same name

nastra commented on code in PR #4826:
URL: https://github.com/apache/iceberg/pull/4826#discussion_r884802408


##########
nessie/src/test/java/org/apache/iceberg/nessie/TestBranchVisibility.java:
##########
@@ -443,4 +443,26 @@ public void testWithRefAndHash() throws NessieConflictException, NessieNotFoundE
     nessieCatalog.createTable(identifier2, schema);
     Assertions.assertThat(nessieCatalog.listTables(namespace)).hasSize(2);
   }
+
+  @Test
+  public void testDifferentTableSameName() throws NessieConflictException, NessieNotFoundException {
+    String branch1 = "branch1";
+    String branch2 = "branch2";
+    createBranch(branch1, null);
+    createBranch(branch2, null);
+    Schema schema1 = new Schema(Types.StructType.of(required(1, "id", Types.LongType.get())).fields());
+    Schema schema2 = new Schema(Types.StructType.of(
+        required(1, "file_count", Types.IntegerType.get()),
+        required(2, "record_count", Types.LongType.get())).fields());
+
+    TableIdentifier identifier = TableIdentifier.of("db1.", "table1");

Review Comment:
   nit: replace `db1.` with `db`



##########
nessie/src/test/java/org/apache/iceberg/nessie/TestBranchVisibility.java:
##########
@@ -443,4 +443,26 @@ public void testWithRefAndHash() throws NessieConflictException, NessieNotFoundE
     nessieCatalog.createTable(identifier2, schema);
     Assertions.assertThat(nessieCatalog.listTables(namespace)).hasSize(2);
   }
+
+  @Test
+  public void testDifferentTableSameName() throws NessieConflictException, NessieNotFoundException {
+    String branch1 = "branch1";
+    String branch2 = "branch2";
+    createBranch(branch1, null);
+    createBranch(branch2, null);
+    Schema schema1 = new Schema(Types.StructType.of(required(1, "id", Types.LongType.get())).fields());
+    Schema schema2 = new Schema(Types.StructType.of(
+        required(1, "file_count", Types.IntegerType.get()),
+        required(2, "record_count", Types.LongType.get())).fields());
+
+    TableIdentifier identifier = TableIdentifier.of("db1.", "table1");
+
+    NessieCatalog nessieCatalog = initCatalog(branch1);
+    String location1 = nessieCatalog.createTable(identifier, schema1).location();

Review Comment:
   can we also verify that each table has the correct schema?



-- 
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-unsubscribe@iceberg.apache.org

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


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