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


##########
phoenix-core-server/src/main/java/org/apache/phoenix/hbase/index/IndexRegionObserver.java:
##########
@@ -1588,10 +1680,36 @@ private List<Mutation> 
generateOnDupMutations(BatchMutateContext context, Put at
               delete.add(cell);
           }
       }
+
+      if (put != null) {
+          // if put is empty and delete is null, remove the empty put from 
mutations,
+          // otherwise we should also add empty cell timestamp for update
+          if (put.isEmpty() && delete == null) {
+              mutations.remove(put);
+          } else {
+              addEmptyKVCells(put, delete, tuple);
+          }
+      }
+
       return mutations;
   }
 
-
+    private void addEmptyKVCells(Put put, Delete delete, MultiKeyValueTuple 
tuple) throws IOException {
+        Set<byte[]> familySet = new HashSet<>();
+        if (!put.isEmpty()) {
+            familySet.addAll(put.getFamilyCellMap().keySet());
+        }
+        if (delete != null) {
+            familySet.addAll(delete.getFamilyCellMap().keySet());
+        }
+        for (byte[] familyBytes : familySet) {
+            Cell emptyKVCell = tuple.getValue(familyBytes,
+                    QueryConstants.ENCODED_EMPTY_COLUMN_BYTES);

Review Comment:
   Since we don't seem to have PTable object here (unless used by expression 
evaluation), probably it might be good to send boolean flag 
(isTableQualifiersEncoded) from client side as Mutation attribute. WDYT 
@tkhurana?



-- 
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: issues-unsubscr...@phoenix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to