yuqi1129 commented on code in PR #10383:
URL: https://github.com/apache/gravitino/pull/10383#discussion_r2959791562


##########
catalogs-contrib/catalog-jdbc-clickhouse/src/main/java/org/apache/gravitino/catalog/clickhouse/operations/ClickHouseTableOperations.java:
##########
@@ -798,14 +804,19 @@ protected String generateAlterTableSql(
       String newComment = updateComment.getNewComment();
       if (null == StringIdentifier.fromComment(newComment)) {
         // Detect and add Gravitino id.
-        JdbcTable jdbcTable = getOrCreateTable(databaseName, tableName, 
lazyLoadTable);
-        StringIdentifier identifier = 
StringIdentifier.fromComment(jdbcTable.comment());
+        lazyLoadTable = getOrCreateTable(databaseName, tableName, 
lazyLoadTable);
+        StringIdentifier identifier = 
StringIdentifier.fromComment(lazyLoadTable.comment());
         if (null != identifier) {
           newComment = StringIdentifier.addToComment(identifier, newComment);
         }
       }
-      String escapedComment = newComment.replace("'", "''");
-      alterSql.add(" MODIFY COMMENT '%s'".formatted(escapedComment));
+      // Re-embed cluster metadata so it is not lost when the comment is 
updated.
+      lazyLoadTable = getOrCreateTable(databaseName, tableName, lazyLoadTable);

Review Comment:
   Add comment



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