kbendick commented on code in PR #5118:
URL: https://github.com/apache/iceberg/pull/5118#discussion_r907743887


##########
core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java:
##########
@@ -225,6 +225,16 @@ public static LoadTableResponse loadTable(Catalog catalog, 
TableIdentifier ident
     Table table = catalog.loadTable(ident);
 
     if (table instanceof BaseTable) {
+      // This gives
+      // TestRESTCatalog > testCompleteReplaceTransaction() FAILED
+      // java.lang.AssertionError: Table should have correct number of 
previous metadata locations expected:<1> but was
+      //   :<2>
+      // TableMetadata metadataWithoutLocation = ((BaseTable) 
table).operations().current();
+      // String metadataLocation = ((BaseTable) 
table).operations().metadataFileLocation("metadataV1.json");
+      // TableMetadata metadata = 
TableMetadata.buildFrom(metadataWithoutLocation)
+      //     .withMetadataLocation(metadataLocation)
+      //     .build();
+      // String metadataLocation = ((BaseTable) 
table).operations().current().previousFiles();
       return LoadTableResponse.builder()
           .withTableMetadata(((BaseTable) table).operations().current())

Review Comment:
   It actually does have metadata location by this point in time. There's some 
internal usage of `LoadTableResponse` where the `metadataLocation` isn't known 
(e.g. during `stageCreate` inside of `RESTSessionCatalog`).
   
   Removing the requirement that the `LoadTableResponse` builder have 
`metadataLocation` at all times fixes this.



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