sungwy commented on code in PR #4356:
URL: https://github.com/apache/polaris/pull/4356#discussion_r3351755511


##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/common/CatalogHandler.java:
##########
@@ -244,6 +282,27 @@ protected void authorizeBasicTableLikeOperationsOrThrow(
       PolarisEntitySubType subType,
       TableIdentifier identifier) {
     ensureResolutionManifestForTable(identifier);
+    if (resolutionManifest.getPrimaryResolverStatus() == null) {

Review Comment:
   This is a good call out. I broke down resolution and authorization into two 
separate methods so we can have the caller ensure that resolution is being 
called once



##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/common/CatalogHandler.java:
##########
@@ -288,20 +328,61 @@ protected void 
ensureResolutionManifestForTable(TableIdentifier identifier) {
               PolarisCatalogHelpers.tableIdentifierToList(identifier),
               PolarisEntityType.TABLE_LIKE,
               true /* optional */));
-      resolutionManifest.resolveAll();
     }
   }
 
-  protected void authorizeBasicTableLikeOperationOrThrow(
+  protected void resolveBasicTableLikeTargetOrThrow(

Review Comment:
   note to reviewer: we have a few cases where we resolve only once, and then 
authorize using the same manifest in `IcebergCatalogHandler` like in 
`updateTable` and `loadTable`.
   
   Having two separate methods for resolution and authorization ensures that we 
are resolving just once, without relying on a logic that checks if we have yet 
to resolve - like `if (resolutionManifest.getPrimaryResolverStatus() == null)` 
- which is more errorprone.



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