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


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



##########
ql/src/java/org/apache/hadoop/hive/ql/parse/ColumnStatsAutoGatherContext.java:
##########
@@ -274,50 +276,71 @@ private void replaceSelectOperatorProcess(SelectOperator 
operator, Operator<? ex
       columnExprMap.put(internalName, exprNodeDesc);
       signature.add(selRSSig.get(selRSIdx));
     }
+    int dynPartsCount=0;
+    if (partSpec != null) {
+      for (Map.Entry<String, String> entry : partSpec.entrySet()) {
+        if (entry.getValue() == null) {
+          dynPartsCount++;
+        }
+      }
+    }
+    boolean inputRRHasStaticParts = (this.columns.size() + dynPartsCount < 
columns.size());
     // if there is any partition column (in static partition or dynamic
     // partition or mixed case)
-    int dynamicPartBegin = -1;
+    int dynamicPartBegin = 0;

Review Comment:
   done, minor change:
   ```
   if (dynamicPartSeen) {
             throw new SemanticException(
                 "Dynamic partition columns should not come before static 
partition columns.");
           }
   ```
   this part needs to be inside `else` block of `if (inputRRHasStaticParts) {` 
because it only makes sense for native tables as row resolver skips the static 
part cols after data cols



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