Fokko commented on PR #921: URL: https://github.com/apache/iceberg-python/pull/921#issuecomment-2227093971
Just to expand on top of https://github.com/apache/iceberg-python/pull/921#issuecomment-2227052294 This is the situation where you already have two Iceberg schemas with the IDs assigned. I think an easier approach to solve this problem is to first convert the Arrow schema to an Iceberg schema (similar to the logic with the name-mapping), and then compare the two Iceberg schemas. The process would look like: - Convert the Arrow schema into Iceberg using name-mapping, similar to [here](https://github.com/apache/iceberg-python/blob/3f44dfe711e96beda6aa8622cf5b0baffa6eb0f2/pyiceberg/io/pyarrow.py#L2082-L2086) - Compare the two schemas using a `SchemaWithPartnerVisitor` if they are compatible. If not, we should generate a pretty error. - If they are compatible, we should be able to just push the schema through `to_requested_schema` to align/cast the fields. -- 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