JingsongLi commented on code in PR #4611:
URL: https://github.com/apache/paimon/pull/4611#discussion_r1865408781


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/DataCatalogTable.java:
##########
@@ -104,27 +124,24 @@ private Schema toSchema(TableSchema tableSchema, 
Map<String, String> comments) {
                                 
builder.withComment(nonPhysicalColumnComments.get(colName));
                             }
                         });
-
         tableSchema
                 .getWatermarkSpecs()
                 .forEach(
                         spec ->
                                 builder.watermark(
-                                        spec.getRowtimeAttribute(), 
spec.getWatermarkExpr()));
-
+                                        spec.getColumnName(), 
spec.getWatermarkExpression()));
         if (tableSchema.getPrimaryKey().isPresent()) {
-            UniqueConstraint primaryKey = tableSchema.getPrimaryKey().get();
-            builder.primaryKeyNamed(primaryKey.getName(), 
primaryKey.getColumns());
+            Schema.UnresolvedPrimaryKey primaryKey = 
tableSchema.getPrimaryKey().get();
+            builder.primaryKeyNamed(primaryKey.getConstraintName(), 
primaryKey.getColumnNames());
         }
-
         return builder.build();
     }
 
     @Override
     public CatalogBaseTable copy() {
         return new DataCatalogTable(
                 table,
-                getSchema().copy(),
+                Schema.newBuilder().fromSchema(schema).build(),

Review Comment:
   Why need to copy it? I see there is no copy in `DefaultCatalogTable`.



-- 
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: issues-unsubscr...@paimon.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to