mansehajsingh commented on code in PR #1037:
URL: https://github.com/apache/polaris/pull/1037#discussion_r2010965739


##########
service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java:
##########
@@ -1374,9 +1393,9 @@ public void doCommit(TableMetadata base, TableMetadata 
metadata) {
             tableIdentifier, oldLocation, newLocation, existingLocation);
       }
       if (null == existingLocation) {
-        createTableLike(tableIdentifier, entity);
+        this.tableEntity = createTableLike(tableIdentifier, entity);
       } else {
-        updateTableLike(tableIdentifier, entity);
+        this.tableEntity = updateTableLike(tableIdentifier, entity);

Review Comment:
   One way we might be able to address this is:
   
   * Have `currentTableEntity` refresh the `tableLikeEntity` if it is null
   * Keep `doRefresh()` the same- refreshing the entity each time so that the 
entity is guaranteed to be in line with the loaded table metadata
   * Instead of populating the entity on `doCommit` where you pointed out, 
since `CatalogHandlers` already called current() on the `TableOperations` this 
means we made an extra hit to the metastore anyway since `current() would have 
called `doRefresh()`. This means there is 1 extra metastore operation on 
registerTable and createTable from the current implementation, but I believe 
this is the same number of metastore operations as before this change



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

Reply via email to