You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/01/04 18:24:44 UTC

[GitHub] [iceberg] stevenzwu commented on a change in pull request #3614: Flink: Fix ALTER for tables with primary key fields

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



##########
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:
       why can't we use the `org.apache.flink.table.api.Schema#equals`?




-- 
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-unsubscribe@iceberg.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org