virajjasani commented on code in PR #2008:
URL: https://github.com/apache/phoenix/pull/2008#discussion_r1841513123
##########
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:
Client expects only COUNT(*) result returned in Tuple at this place. Now
that we need to return the row result, we need to break this mandatory
translation of count result anyway right?
--
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]