Fokko commented on code in PR #1580:
URL: https://github.com/apache/iceberg-python/pull/1580#discussion_r1931152082
##########
pyiceberg/catalog/hive.py:
##########
@@ -404,7 +404,22 @@ def register_table(self, identifier: Union[str,
Identifier], metadata_location:
Raises:
TableAlreadyExistsError: If the table already exists
"""
- raise NotImplementedError
+ database_name, table_name =
self.identifier_to_database_and_table(identifier)
+ io = self._load_file_io(location=metadata_location)
+ metadata_file = io.new_input(metadata_location)
+ staged_table = StagedTable(
+ identifier=(database_name, table_name),
+ metadata=FromInputFile.table_metadata(metadata_file),
+ metadata_location=metadata_location,
+ io=io,
+ catalog=self,
+ )
+ tbl = self._convert_iceberg_into_hive(staged_table)
+ with self._client as open_client:
Review Comment:
I don't think we have to acquire a lock, see `create_table`. In case the
table already exists, we'll get an exception. There is no race condition as
with `commit_table` where two clients silently can overwrite the table.
--
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]