rdblue commented on code in PR #5447:
URL: https://github.com/apache/iceberg/pull/5447#discussion_r940543443


##########
python/pyiceberg/catalog/hive.py:
##########
@@ -229,24 +290,43 @@ def create_table(
             ValueError: If the identifier is invalid
         """
         database_name, table_name = 
self.identifier_to_database_and_table(identifier)
-        current_time_millis = int(time.time())
+        seconds_since_epoch = int(time.time())
+
+        location = self._resolve_table_location(location, database_name, 
table_name)
+
+        metadata_location = f"{location}metadata/{uuid.uuid4()}.metadata.json"
+        metadata = TableMetadataV2(
+            location=location,
+            schemas=[schema],

Review Comment:
   Here's what we do in Java: 
https://github.com/apache/iceberg/blob/master/core/src/main/java/org/apache/iceberg/TableMetadata.java#L88-L133
   
   When the table metadata builder adds a schema, spec, or order, the builder 
will check whether it is an existing order and find out the ID to assign. We 
should do something similar here.
   
   This probably isn't something to do in this PR (since this is focused on 
Hive) but introducing the builder would probably be a good idea. That's how we 
also accumulate the change set that we pass to the REST catalog when committing 
table changes. I'd say let's move forward with what you have here (except 
passing the IDs rather than hard-coding to 0) and we can add reassignment later.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to