pvary commented on code in PR #3308:
URL: https://github.com/apache/hive/pull/3308#discussion_r879197350


##########
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/LockRequestBuilder.java:
##########
@@ -168,8 +169,9 @@ private void setPart(LockComponent comp, PartTrie parts) {
       if (existing == null) {
         // No existing lock for this partition.
         parts.put(comp.getPartitionname(), comp);
-      }  else if (lockTypeComparator.compare(comp.getType(), 
existing.getType()) > 0) {
-        // We only need to promote if comp.type is > existing.type.
+      } else if (lockTypeComparator.compare(comp.getType(), 
existing.getType()) > 0
+          || comp.getType() == existing.getType() && 
existing.getOperationType() == DataOperationType.INSERT) {

Review Comment:
   Discussed offline:
   - We store the `DataOperationType` for the locks further down the line.
   
   Could we:
   - Add a comment here
   - Check for the operationType too, and add only if it is new?



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