You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/04/28 08:33:28 UTC

[GitHub] [hive] pvary commented on a change in pull request #2230: HIVE-25065: Implement ALTER TABLE for setting iceberg table properties

pvary commented on a change in pull request #2230:
URL: https://github.com/apache/hive/pull/2230#discussion_r621938901



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/ddl/table/AbstractAlterTableOperation.java
##########
@@ -136,6 +137,22 @@ private void finalizeAlterTableWithWriteIdOp(Table table, Table oldTable, List<P
 
     try {
       environmentContext.putToProperties(HiveMetaHook.ALTER_TABLE_OPERATION_TYPE, desc.getType().name());
+      if (desc.getType() == AlterTableType.ADDPROPS) {
+        Map<String, String> oldTableParameters = oldTable.getParameters();
+        environmentContext.putToProperties(HiveMetaHook.SET_PROPERTIES,
+            table.getParameters().entrySet().stream()
+                .filter(e -> !oldTableParameters.containsKey(e.getKey()) ||
+                    !oldTableParameters.get(e.getKey()).equals(e.getValue()))
+                .map(Map.Entry::getKey)
+                .collect(Collectors.joining(HiveMetaHook.PROPERTIES_SEPARATOR)));

Review comment:
       Does this handle the situation where the separator appears in one of the key/value?




-- 
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:
users@infra.apache.org



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