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 12:28:50 UTC

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

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



##########
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:
       I've added a separate check to look for the separator among the property keys and throw an exception if an invalid character is found.




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