File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -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
@@ -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 ,
You can’t perform that action at this time.
0 commit comments