ayushtkn commented on code in PR #4750:
URL: https://github.com/apache/polaris/pull/4750#discussion_r3414827922


##########
runtime/service/src/test/java/org/apache/polaris/service/catalog/iceberg/AbstractIcebergCatalogHandlerAuthzTest.java:
##########
@@ -1296,6 +1297,18 @@ public void 
testRenameTablePrivilegesOnWrongSourceOrDestination() {
         adminService.grantPrivilegeOnNamespaceToRole(
             CATALOG_NAME, CATALOG_ROLE1, NS2, PolarisPrivilege.TABLE_CREATE));
     newHandler().renameTable(rename2);
+
+    // Verify that renaming a non-existent source reports the source 
identifier in the error
+    TableIdentifier nonExistentSource = TableIdentifier.of(NS1, 
"no_such_table");
+    TableIdentifier destination = TableIdentifier.of(NS1AA, "another");
+    RenameTableRequest badRename =

Review Comment:
   It doesn't repro it there for me :-( 
    - `AbstractLocalIcebergCatalogTest` calls `catalog().renameTable(from, to)` 
→ goes directly to `LocalIcebergCatalog.renameTableLike()` (line 2439), which 
already correctly puts from in the error
      message
     - The bug was in 
`CatalogHandler.authorizeRenameTableLikeOperationOrThrow()` (line 394) — the 
auth/resolution layer that runs before the catalog is even invoked              
                
                                                                                
                                                                                
                                 
     These are two separate code paths:                                         
                                                                                
                                 
                                                                                
                                                                                
                                 
     `AbstractLocalIcebergCatalogTest`:                                         
                                                                                
                                   
       `catalog.renameTable()` → `LocalIcebergCatalog.renameTableLike()`  ← bug 
is NOT here                                                                     
                                     
                                                                                
                                                                                
                                 
     `AbstractIcebergCatalogHandlerAuthzTest`:                                  
                                                                                
                                   
       `handler.renameTable()` → 
`CatalogHandler.authorizeRenameTableLikeOperationOrThrow()`  ← bug IS here      
                                                                                
    
                             → then `LocalIcebergCatalog.renameTableLike()`     
                                                                                
                                   
                                                                                
                                                                                
                                 
     When the source doesn't exist, the `auth` layer catches it first (during 
resolution) and throws — the code never reaches `LocalIcebergCatalog`. So 
`AbstractLocalIcebergCatalogTest` can't    
     reproduce this bug                



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