Mehul2500 commented on code in PR #5037:
URL: https://github.com/apache/iceberg/pull/5037#discussion_r901490027
##########
nessie/src/test/java/org/apache/iceberg/nessie/TestNessieTable.java:
##########
@@ -356,6 +361,107 @@ public void testListTables() {
Assertions.assertThat(catalog.tableExists(TABLE_IDENTIFIER)).isTrue();
}
+ private void testRegister(TableIdentifier identifier, List<String>
metadataVersionFiles) {
+ Assertions.assertThat(catalog.dropTable(identifier, false)).isFalse();
+ Assertions.assertThat(catalog.registerTable(
+ identifier,
+ "file:" + metadataVersionFiles.get(0))).isNotNull();
+ Table newTable = catalog.loadTable(identifier);
+ Assertions.assertThat(newTable).isNotNull();
+ TableOperations ops = ((HasTableOperations) newTable).operations();
+ String metadataLocation = ((NessieTableOperations)
ops).currentMetadataLocation();
+ Assertions.assertThat("file:" +
metadataVersionFiles.get(0)).isEqualTo(metadataLocation);
+ Assertions.assertThat(catalog.tableExists(identifier)).isTrue();
+ }
+
+ @Test
+ public void testRegisterTableWithGivenBranch() {
+ List<String> metadataVersionFiles = metadataVersionFiles(TABLE_NAME);
+ Assertions.assertThat(1).isEqualTo(metadataVersionFiles.size());
+ ImmutableTableReference tableReference =
+
ImmutableTableReference.builder().reference("main").name(TABLE_NAME).build();
+ TableIdentifier identifier = TableIdentifier.of(DB_NAME,
tableReference.toString());
+ testRegister(identifier, metadataVersionFiles);
Review Comment:
No, that's not the case, it consumes identifier as one of the arguments
which has been fed with "main", as the reference.
--
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]