jerryshao commented on code in PR #13316:
URL: https://github.com/apache/gravitino/pull/13316#discussion_r4046766739


##########
core/src/main/java/org/apache/gravitino/hook/TableHookDispatcher.java:
##########
@@ -116,9 +121,15 @@ public Table alterTable(NameIdentifier ident, 
TableChange... changes)
     Table alteredTable = dispatcher.alterTable(ident, changes);
 
     if (lastRenameChange != null) {
-      // todo: support rename across different schemas
+      // The rename may also move the table to another schema.
+      NameIdentifier newIdent =
+          NameIdentifierUtil.ofTable(
+              ident.namespace().level(0),
+              ident.namespace().level(1),
+              newSchemaName,
+              lastRenameChange.getNewName());
       AuthorizationUtils.authorizationPluginRenamePrivileges(

Review Comment:
   Added `TestRangerAuthorizationHadoopSQLPlugin` (cross-schema and same-schema 
table rename). It exposed a plugin bug: the schema-level step of a table rename 
moved every policy of the old schema to the new one, so 
`RangerAuthorizationHadoopSQLPlugin` now skips that step and moves only the 
table's own policies (9fa2eb002).
   
   _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_



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