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


##########
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:
   Good one, we do have validators on them when we initialize the Pydantic 
models, but there is no re-assignment being done. Do you want to set them to 
zero? We could also set the `schema_id` by default to zero?



##########
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],
+            current_schema_id=schema.schema_id,
+            partition_specs=[partition_spec],
+            default_spec_id=0,

Review Comment:
   Much better indeed



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