syun64 commented on code in PR #305:
URL: https://github.com/apache/iceberg-python/pull/305#discussion_r1470130736


##########
pyiceberg/schema.py:
##########
@@ -1221,50 +1221,57 @@ def assign_fresh_schema_ids(schema_or_type: 
Union[Schema, IcebergType], next_id:
 class _SetFreshIDs(PreOrderSchemaVisitor[IcebergType]):
     """Traverses the schema and assigns monotonically increasing ids."""
 
-    reserved_ids: Dict[int, int]
+    old_id_to_new_id: Dict[int, int]

Review Comment:
   Ah interesting! Does this mean we could remove this from _SetFieldIDs, and 
instead handle the identifier_field_names update in the corresponding operation 
that requires updating identifier_field_names to the new IDs? That would 
simplify this visitor even more 😄 
   
   Right now, only create_table uses this visitor and doesn't require 
identifier_field_names to be updated (it'll always be an empty list for a new 
table)
   
   If 
[UpdateSchema](https://github.com/apache/iceberg-python/blob/a3e36838b05e4ccccac434ab394af758054b12d6/pyiceberg/table/__init__.py#L1437)
 is already doing this within corresponding class that wraps the transaction, I 
think we could do the same in other operations that would need to do the same 
(like ReplaceTable) instead of keeping this feature within _SetFieldIDs



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