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


##########
phoenix-core-client/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java:
##########
@@ -833,14 +847,24 @@ public MutationState execute() throws SQLException {
                 }
                 ResultIterator iterator = aggPlan.iterator();
                 try {
-                    Tuple row = iterator.next();
-                    final long mutationCount = (Long) 
projector.getColumnProjector(0).getValue(row, PLong.INSTANCE, ptr);
-                    return new MutationState(maxSize, maxSizeBytes, 
connection) {
-                        @Override
-                        public long getUpdateCount() {
-                            return mutationCount;
-                        }
-                    };
+                    byte[] singleRowDelete =
+                            context.getScan().getAttribute(
+                                    
BaseScannerRegionObserverConstants.SINGLE_ROW_DELETE);
+                    boolean isSingleRowDelete = singleRowDelete != null &&
+                            Bytes.compareTo(PDataType.TRUE_BYTES, 
singleRowDelete) == 0;
+                    if (isSingleRowDelete) {
+                        return deleteRowAndGetMutationState(table);
+                    } else {
+                        Tuple row = iterator.next();

Review Comment:
   Why are we going out of the way to do a separate scan? We already know it is 
a singleRowDelete. We can take different actions based on that information on 
the tuple that is returned by the server.



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