virajjasani commented on code in PR #1736:
URL: https://github.com/apache/phoenix/pull/1736#discussion_r1451600917
##########
phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/IndexerRegionScanner.java:
##########
@@ -435,12 +437,33 @@ public boolean next(List<Cell> results) throws
IOException {
mutations.clear();
}
}
- byte[] rowCountBytes = PLong.INSTANCE.toBytes(Long.valueOf(rowCount));
+ byte[] rowCountBytes = PLong.INSTANCE.toBytes((long) rowCount);
final Cell aggKeyValue;
if (lastCell == null) {
- aggKeyValue =
PhoenixKeyValueUtil.newKeyValue(UNGROUPED_AGG_ROW_KEY,
- SINGLE_COLUMN_FAMILY,
- SINGLE_COLUMN, AGG_TIMESTAMP, rowCountBytes,0,
rowCountBytes.length);
+ byte[] rowKey;
+ byte[] startKey = scan.getStartRow().length > 0 ?
scan.getStartRow() :
+ region.getRegionInfo().getStartKey();
+ byte[] endKey = scan.getStopRow().length > 0 ? scan.getStopRow() :
+ region.getRegionInfo().getEndKey();
+ final boolean isIncompatibleClient =
+
ScanUtil.isIncompatibleClientForServerReturnValidRowKey(scan);
+ if (!isIncompatibleClient) {
+ rowKey = ByteUtil.getLargestPossibleRowKeyInRange(startKey,
endKey);
+ if (rowKey == null) {
+ if (scan.includeStartRow()) {
Review Comment:
This logic applies to the places where we just want to return count value to
client such that we would not come back to the region again even if it moves.
AFAIK, these cases are safe because scan operation is not continued but let me
spend a bit more time to ensure this is certainly true.
--
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]