marton-bod commented on a change in pull request #2230:
URL: https://github.com/apache/hive/pull/2230#discussion_r622344816



##########
File path: 
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergMetaHook.java
##########
@@ -251,6 +254,21 @@ public void 
commitAlterTable(org.apache.hadoop.hive.metastore.api.Table hmsTable
       }
       HiveTableUtil.importFiles(preAlterTableProperties.tableLocation, 
preAlterTableProperties.format,
           partitionSpecProxy, preAlterTableProperties.partitionKeys, 
catalogProperties, conf);
+    } else {
+      Map<String, String> contextProperties = context.getProperties();
+      if (contextProperties.containsKey(ALTER_TABLE_OPERATION_TYPE) &&
+          
allowedAlterTypes.contains(contextProperties.get(ALTER_TABLE_OPERATION_TYPE))) {
+        Map<String, String> hmsTableParameters = hmsTable.getParameters();
+        Splitter splitter = Splitter.on(PROPERTIES_SEPARATOR);
+        UpdateProperties icebergUpdateProperties = 
icebergTable.updateProperties();
+        if (contextProperties.containsKey(SET_PROPERTIES)) {
+          splitter.splitToList(contextProperties.get(SET_PROPERTIES))
+              .forEach(k -> icebergUpdateProperties.set(k, 
hmsTableParameters.get(k)));
+        } else {

Review comment:
       maybe make this `else if 
(contextProperties.containsKey(UNSET_PROPERTIES))`? We might later call this 
method from other alter table ops (e.g. schema change) and we wouldn't want to 
enter this block then




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to