deniskuzZ commented on code in PR #4852:
URL: https://github.com/apache/hive/pull/4852#discussion_r1400218713


##########
ql/src/java/org/apache/hadoop/hive/ql/parse/rewrite/MergeRewriter.java:
##########
@@ -217,13 +218,17 @@ public void 
appendWhenMatchedUpdateClause(MergeStatement.UpdateClause updateClau
     }
 
     protected void addValues(Table targetTable, String targetAlias, 
Map<String, String> newValues,
-                             List<String> values) {
+                             List<String> values, boolean aliasRhsExpr) {
       for (FieldSchema fieldSchema : targetTable.getCols()) {
+        String value = String.format("%s.%s", targetAlias, 
HiveUtils.unparseIdentifier(fieldSchema.getName(), conf));
         if (newValues.containsKey(fieldSchema.getName())) {
-          values.add(newValues.get(fieldSchema.getName()));
+          String rhsExp = newValues.get(fieldSchema.getName());
+          if (aliasRhsExpr){
+            rhsExp += String.format(" AS %s", value);
+          }
+          values.add(rhsExp);

Review Comment:
   i don't see any benefit in this, `aliasRhsExpr` is an extra param, that is 
false in a base class and true in 1 of the children. btw, MergeRwriter - is a 
base class



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to