tkhurana commented on code in PR #1884:
URL: https://github.com/apache/phoenix/pull/1884#discussion_r1621490281
##########
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:
We already serializing the PTable object and re-creating on the server so we
can get the encoding information
https://github.com/apache/phoenix/blob/master/phoenix-core-server/src/main/java/org/apache/phoenix/hbase/index/IndexRegionObserver.java#L1482
--
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]