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


##########
catalogs/catalog-generic-lakehouse/src/main/java/org/apache/gravitino/catalog/lakehouse/lance/LanceCatalogOperations.java:
##########
@@ -206,17 +210,66 @@ public Table alterTable(NameIdentifier ident, 
TableChange... changes)
       }
     }
 
-    EntityStore entityStore = GravitinoEnv.getInstance().entityStore();
-    GenericTableEntity entity;
+    TableEntity updatedEntity;
     try {
-      entity = entityStore.get(ident, Entity.EntityType.TABLE, 
GenericTableEntity.class);
+      TableEntity entity = store.get(ident, Entity.EntityType.TABLE, 
TableEntity.class);
+      updatedEntity =
+          store.update(
+              ident,
+              TableEntity.class,
+              TABLE,
+              tableEntity ->
+                  TableEntity.builder()
+                      .withId(tableEntity.id())
+                      .withName(tableEntity.name())
+                      .withNamespace(tableEntity.namespace())
+                      .withFormat(entity.getFormat())
+                      .withAuditInfo(
+                          AuditInfo.builder()
+                              .withCreator(tableEntity.auditInfo().creator())
+                              
.withCreateTime(tableEntity.auditInfo().createTime())
+                              
.withLastModifier(PrincipalUtils.getCurrentPrincipal().getName())
+                              .withLastModifiedTime(Instant.now())
+                              .build())
+                      .withColumns(tableEntity.columns())
+                      .withIndexes(
+                          ArrayUtils.addAll(
+                              entity.getIndexes(), addedIndexes.toArray(new 
Index[0])))
+                      .withDistribution(tableEntity.getDistribution())
+                      .withPartitions(tableEntity.getPartitions())
+                      .withSortOrder(tableEntity.getSortOrder())
+                      .withProperties(tableEntity.getProperties())
+                      .withComment(tableEntity.getComment())
+                      .build());

Review Comment:
   What is updated here?



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