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