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