liamzwbao commented on code in PR #13072: URL: https://github.com/apache/iceberg/pull/13072#discussion_r2119175506
########## flink/v2.0/flink/src/main/java/org/apache/iceberg/flink/FlinkSchemaUtil.java: ########## @@ -192,7 +222,9 @@ public static Type convert(LogicalType flinkType) { * * @param rowType a RowType * @return Flink TableSchema + * @deprecated use {@link #toResolvedSchema(RowType)} instead */ + @Deprecated public static TableSchema toSchema(RowType rowType) { Review Comment: As [`CatalogManager`](https://github.com/apache/flink/blob/master/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/CatalogManager.java#L94) is marked as internal, and it must be accessed via [`TableEnvironmentInternal`](https://github.com/apache/flink/blob/986ab8660f7b5877b316bbea5fa857bce348580b/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentInternal.java#L57), I decided to add the necessary validation manually. Additionally, since Iceberg schema already enforces duplicate field validation, we don't need to duplicate that check. Therefore, I only copied the primary key validation logic from Flink. Also, since `ResolvedSchema toResolvedSchema(RowType rowType)` is only used in tests, I marked it as package-private. That's the update. Please let me know what you think of these changes. Thanks! -- 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...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org