@@ -211,11 +211,18 @@ def _construct_hive_storage_descriptor(
211211DEFAULT_PROPERTIES = {TableProperties .PARQUET_COMPRESSION : TableProperties .PARQUET_COMPRESSION_DEFAULT }
212212
213213
214- def _construct_parameters (metadata_location : str , previous_metadata_location : Optional [str ] = None ) -> Dict [str , Any ]:
214+ def _construct_parameters (
215+ metadata_location : str , previous_metadata_location : Optional [str ] = None , metadata_properties : Optional [Properties ] = None
216+ ) -> Dict [str , Any ]:
215217 properties = {PROP_EXTERNAL : "TRUE" , PROP_TABLE_TYPE : "ICEBERG" , PROP_METADATA_LOCATION : metadata_location }
216218 if previous_metadata_location :
217219 properties [PROP_PREVIOUS_METADATA_LOCATION ] = previous_metadata_location
218220
221+ if metadata_properties :
222+ for key , value in metadata_properties .items ():
223+ if key not in properties :
224+ properties [key ] = str (value )
225+
219226 return properties
220227
221228
@@ -360,7 +367,7 @@ def _convert_iceberg_into_hive(self, table: Table) -> HiveTable:
360367 property_as_bool (self .properties , HIVE2_COMPATIBLE , HIVE2_COMPATIBLE_DEFAULT ),
361368 ),
362369 tableType = EXTERNAL_TABLE ,
363- parameters = _construct_parameters (table .metadata_location ),
370+ parameters = _construct_parameters (metadata_location = table .metadata_location , metadata_properties = table . properties ),
364371 )
365372
366373 def _create_hive_table (self , open_client : Client , hive_table : HiveTable ) -> None :
@@ -541,6 +548,7 @@ def commit_table(
541548 hive_table .parameters = _construct_parameters (
542549 metadata_location = updated_staged_table .metadata_location ,
543550 previous_metadata_location = current_table .metadata_location ,
551+ metadata_properties = updated_staged_table .properties ,
544552 )
545553 open_client .alter_table_with_environment_context (
546554 dbname = database_name ,
0 commit comments