yuqi1129 commented on code in PR #11292:
URL: https://github.com/apache/gravitino/pull/11292#discussion_r3321682688
##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveCatalogOperations.java:
##########
@@ -697,12 +675,21 @@ public Table alterTable(NameIdentifier tableIdent,
TableChange... changes)
String newComment = currentTable.comment();
Map<String, String> updatedProperties = new
HashMap<>(currentTable.properties());
List<Column> updatedColumns = new
ArrayList<>(Arrays.asList(currentTable.columns()));
+ String targetDatabaseName = schemaIdent.name(); // Define a separate
variable to track the target database name.
+
for (TableChange change : changes) {
if (change instanceof TableChange.RenameTable) {
TableChange.RenameTable rename = (TableChange.RenameTable) change;
- Preconditions.checkArgument(
- rename.getNewSchemaName().isEmpty(), "Does not support rename
schema yet");
+ if (rename.getNewSchemaName().isPresent()) { // Check if a new
schema is specified for the table rename
+ String newSchemaName = rename.getNewSchemaName().get();
+ if (!schemaExists( // Validate that the target schema exists
before moving the table
Review Comment:
1. Does this problem only exist in Hive catalogs?
--
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]