liamzwbao commented on PR #13072:
URL: https://github.com/apache/iceberg/pull/13072#issuecomment-2920724187

   > What are the obstacles for completely getting rid of TableSchema?
   
   Hi @mxm, do you mean removing all usages of `TableSchema` in a single PR? I 
think that would result in a fairly large change, which might be difficult to 
review. So my current plan is to break it down into smaller PRs. However, if 
you believe it's better to handle it all in one PR, I can give that a try.
   
   As for the obstacles, one current discrepancy in the migration is that the 
legacy `TableSchema.builder().build()` performs some validation in the 
[`build()` 
method](https://github.com/apache/flink/blob/cc11668578664dbd3627e37badc7f0cb9cdbcf4e/flink-table/flink-table-common/src/main/java/org/apache/flink/table/legacy/api/TableSchema.java#L816-L823).
 These validations are missing when directly using `ResolvedSchema.of()`, as 
they have been moved to the 
[`SchemaResolver`](https://github.com/apache/flink/blob/master/flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/DefaultSchemaResolver.java#L80-L92).
   
   So I see two possible options:
   
   - Add the missing validation logic into the current utility function.
   - Build a `Schema` first and then resolve it to `ResolvedSchema`. However, 
this approach requires a `SchemaResolver`, which may involve API changes. I'm 
not sure how we can obtain a `SchemaResolver` in this context.
   
   For more discussion, please refer to this 
[thread](https://github.com/apache/iceberg/pull/13072#discussion_r2108061992).


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

Reply via email to