stevenzwu commented on a change in pull request #3614:
URL: https://github.com/apache/iceberg/pull/3614#discussion_r778299786



##########
File path: 
flink/v1.13/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java
##########
@@ -400,6 +400,37 @@ void createIcebergTable(ObjectPath tablePath, 
CatalogBaseTable table, boolean ig
     }
   }
 
+  /**
+   * schema.equals() contanins getColumns and getWatermarkSpecs
+   * and "primary key"
+   * primary.equals() contains columnNames and constraintName
+   * columnNames are identifierFields of table and constraintName now generate 
randomly through a function
+   * {@link TableSchema} #primaryKey
+   * so the result is always false because random names are not equal
+   * (two solutions: 1. give specific name like all identifierFields's name 
combination
+   *                 2. change the equals method because table's metadata has 
no constraintName)
+   * @param rawSchema Table original schema
+   * @param newSchema Schema after table change
+   * @return Boolean value of whether the schema is consistent
+   */
+  boolean schemaEquals(org.apache.flink.table.api.Schema rawSchema,

Review comment:
       I read the Javadoc comment. When I read the `UnresolvedPrimaryKey` code, 
it was only comparing the `columnNames`. is it not correct?
   
   ```
           @Override
           public boolean equals(Object o) {
               if (this == o) {
                   return true;
               }
               if (o == null || getClass() != o.getClass()) {
                   return false;
               }
               if (!super.equals(o)) {
                   return false;
               }
               UnresolvedPrimaryKey that = (UnresolvedPrimaryKey) o;
               return columnNames.equals(that.columnNames);
           }
   ```




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to