charlesconnell commented on code in PR #6978:
URL: https://github.com/apache/hbase/pull/6978#discussion_r2096023852
##########
hbase-endpoint/src/main/java/org/apache/hadoop/hbase/coprocessor/AggregateImplementation.java:
##########
@@ -111,11 +111,16 @@ public void getMax(RpcController controller,
AggregateRequest request,
postScanPartialResultUpdate(results, partialResultContext);
results.clear();
} while (hasMoreRows);
- if (max != null) {
- AggregateResponse.Builder builder = AggregateResponse.newBuilder();
- builder.addFirstPart(ci.getProtoForCellType(max).toByteString());
- setPartialResultResponse(builder, request, hasMoreRows,
partialResultContext);
- response = builder.build();
+ if (max != null && !request.getClientSupportsPartialResult()) {
+ ByteString first = ci.getProtoForCellType(max).toByteString();
+ response = AggregateResponse.newBuilder().addFirstPart(first).build();
+ } else if (request.getClientSupportsPartialResult()) {
+ AggregateResponse.Builder responseBuilder =
+ responseBuilder(request, hasMoreRows, partialResultContext);
+ if (max != null) {
+
responseBuilder.addFirstPart(ci.getProtoForCellType(max).toByteString());
+ }
+ response = responseBuilder.build();
Review Comment:
I was able to consolidate some of the code in max, min, and sum
--
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]