diqiu50 opened a new pull request, #11555:
URL: https://github.com/apache/gravitino/pull/11555

   ### What changes were proposed in this pull request?
   
   `GlueIcebergTableHelper.alterTable` threw `IllegalArgumentException` for 
`RenameTable` changes because it only handled `ColumnChange`, `SetProperty`, 
and `RemoveProperty`. The underlying Iceberg `GlueCatalog` natively supports 
`renameTable`, so the capability existed but was never wired up.
   
   Changes:
   - Handle `TableChange.RenameTable` in `GlueIcebergTableHelper.alterTable` by 
delegating to `icebergCatalog.renameTable(from, to)`; return the final table 
name so callers can load the renamed table correctly.
   - Update `GlueCatalogOperations.alterIcebergTable` to use the returned name 
when constructing the `NameIdentifier` for the post-alter `loadTable` call.
   
   ### Why are the changes needed?
   
   Fix: #11538
   
   Users could not rename Iceberg tables in a Gravitino Glue catalog via Spark 
(`ALTER TABLE ... RENAME TO`) or the Java client, even though the underlying 
Iceberg `GlueCatalog` supports rename natively.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes — `ALTER TABLE ... RENAME TO` now works for Iceberg tables in the Glue 
catalog. Previously it always threw `IllegalArgumentException`.
   
   ### How was this patch tested?
   
   - Unit test: 
`TestGlueCatalogOperationsForIceberg#testAlterTable_icebergRenameCallsIcebergRenameTable`
 verifies `icebergCatalog.renameTable` is called with the correct source and 
target identifiers.
   - Spark AWS IT: `SparkAwsGlueCatalogIT35#testRenameIcebergTable` runs 
end-to-end against real AWS Glue: create Iceberg table → insert row → rename → 
verify old name gone, new name exists, data readable.


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