virajjasani commented on code in PR #2008:
URL: https://github.com/apache/phoenix/pull/2008#discussion_r1844918836
##########
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:
To be more specific, for `single row atomic delete returning result` case,
the server is going to return the entire row and not count value as
`non-aggregate CF:CQ` format, hence `Tuple row = iterator.next()` just does not
work, it throws error because the iterator#next expects Cell result to contain
only non-aggregate CF:CQ (s:s).
--
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]