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


##########
ql/src/java/org/apache/hadoop/hive/ql/parse/rewrite/MergeRewriter.java:
##########
@@ -238,20 +238,33 @@ public void 
appendWhenMatchedUpdateClause(MergeStatement.UpdateClause updateClau
 
     protected void addValues(Table targetTable, String targetAlias, 
Map<String, String> newValues,
                              List<String> values) {
-      UnaryOperator<String> formatter = name -> String.format("%s.%s", 
targetAlias, 
+      UnaryOperator<String> formatter = name -> String.format("%s.%s", 
targetAlias,
           HiveUtils.unparseIdentifier(name, conf));
-      
+      List<String> valuesToBeAdded = new ArrayList<>();

Review Comment:
   why do we need this HACK??
   
   could we refactor
   ````
   Set<String> partCols = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
   partCols.addAll(targetTable.getPartColNames());
   boolean nonNativePartitioned = targetTable.hasNonNativePartitionSupport();
   
   for (FieldSchema col : targetTable.getAllCols()) {
     String name = col.getName();
     // Native partition columns cannot be updated; Iceberg partition columns 
are regular updatable columns.
     boolean applyNewValues = nonNativePartitioned || !partCols.contains(name);
     String formatted = formatter.apply(name);
     values.add(applyNewValues && newValues.containsKey(name)
       ? getRhsExpValue(newValues.get(name), formatted) : formatted);
   ````



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