HonahX commented on code in PR #498:
URL: https://github.com/apache/iceberg-python/pull/498#discussion_r1542406368


##########
pyiceberg/catalog/__init__.py:
##########
@@ -717,6 +791,10 @@ def _get_updated_props_and_update_summary(
 
         return properties_update_summary, updated_properties
 
+    @staticmethod
+    def empty_table_metadata() -> TableMetadata:
+        return TableMetadataV1(location="", last_column_id=-1, schema=Schema())

Review Comment:
   The default is still V2 table. When creating a createTableTransaction, we 
first call `new_table_metadata` which by default gives a V2 metadata. Then, we 
parse the initial metadata to a sequence of `TableUpdates`, including an 
`UpgradeFormatVersionUpdate`. Finally when we re-building the metadata in 
`_commit_table`, the `UpgradeFormatVersionUpdate` will bump the metadata to the 
correct version.
   
   If we use V2Metadata here, we won't be able to create any V1 table since we 
cannot downgrade from V2 to V1. I think this is the same issue in 
`iceberg-rest` that prevents us from creating V1 table via 
create-table-transaction.https://github.com/apache/iceberg-python/pull/498#discussion_r1525837679
 I should follow-up that later.
   
   I added some comments to explain the purpose and also make it private. 



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