tkhurana commented on code in PR #1884:
URL: https://github.com/apache/phoenix/pull/1884#discussion_r1621494203


##########
phoenix-core-server/src/main/java/org/apache/phoenix/hbase/index/IndexRegionObserver.java:
##########
@@ -546,9 +568,22 @@ private void 
addOnDupMutationsToBatch(MiniBatchOperationInProgress<Mutation> min
               List<Mutation> mutations = generateOnDupMutations(context, 
(Put)m);
               if (!mutations.isEmpty()) {
                   addOnDupMutationsToBatch(miniBatchOp, i, mutations);
+                  context.setUpdateStatus(i, 
BatchMutateContext.UpdateStatus.UPDATE);
               } else {
-                  // empty list of generated mutations implies ON DUPLICATE 
KEY IGNORE
-                  miniBatchOp.setOperationStatus(i, IGNORE);
+                  // empty list of generated mutations implies
+                  // 1) ON DUPLICATE KEY IGNORE if row already exists, OR
+                  // 2) ON DUPLICATE KEY UPDATE if CASE expression is 
specified and in each of
+                  // them the new value is the same as the old value in the 
ELSE-clause (empty
+                  // cell timestamp will NOT be updated)
+                  byte[] retVal = PInteger.INSTANCE.toBytes(0);

Review Comment:
   Should we directly send an integer or should we introduce here a protobuf 
object which has a field like updateStatus. By sending a protobuf object inside 
the Result will allow us to expand this object in the future by adding more 
fields to it. 



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

Reply via email to