loserwang1024 commented on code in PR #2718:
URL: https://github.com/apache/fluss/pull/2718#discussion_r3027077182


##########
fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/catalog/FlinkCatalog.java:
##########
@@ -491,11 +492,63 @@ public void alterTable(
             throws TableNotExistException, CatalogException {
         TablePath tablePath = toTablePath(objectPath);
 
-        List<TableChange> flussTableChanges =
-                tableChanges.stream()
-                        .filter(Objects::nonNull)
-                        .flatMap(change -> 
FlinkConversions.toFlussTableChanges(change).stream())
-                        .collect(Collectors.toList());
+        TableInfo tableInfo;
+        try {
+            tableInfo = admin.getTableInfo(tablePath).get();
+        } catch (Exception e) {
+            Throwable t = ExceptionUtils.stripExecutionException(e);
+            if (isTableNotExist(t)) {
+                throw new TableNotExistException(getName(), objectPath);
+            }
+            throw new CatalogException(
+                    String.format("Failed to get table %s in %s", objectPath, 
getName()), t);
+        }
+
+        Map<String, Integer> oldTableNonPhysicalColumnIndex =
+                CatalogPropertiesUtils.nonPhysicalColumns(
+                        tableInfo.getCustomProperties().toMap(),
+                        tableInfo.getSchema().getColumnNames());
+
+        // Serialize non-physical columns from new table definition
+        ResolvedCatalogBaseTable<?> resolvedNewTable = 
(ResolvedCatalogBaseTable<?>) newTable;

Review Comment:
   watermark is not non-physical columns, why here deserialize and then 
serialize non-physical columns here?
   
   Please move  `alter a computed column` to another pr? 



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