virajjasani commented on code in PR #1923:
URL: https://github.com/apache/phoenix/pull/1923#discussion_r1666016616


##########
phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/PagingRegionScanner.java:
##########
@@ -81,40 +201,70 @@ private boolean next(List<Cell> results, boolean raw) 
throws IOException {
                 scan.withStartRow(adjustedStartRowKey,
                         Bytes.toBoolean(adjustedStartRowKeyIncludeBytes));
                 PackagePrivateFieldAccessor.setMvccReadPoint(scan, 
mvccReadPoint);
+                if (multiKeyPointLookup != null) {
+                    scan.withStopRow(adjustedStartRowKey, true);
+                    // Reset multiKeyPointLookupPosition to start scanning 
from the first row
+                    multiKeyPointLookup.reset();
+                    multiKeyPointLookup.verifyStartRowKey(adjustedStartRowKey);
+                }
                 delegate = region.getScanner(scan);
                 
scan.setAttribute(QueryServices.PHOENIX_PAGING_NEW_SCAN_START_ROWKEY, null);
                 
scan.setAttribute(QueryServices.PHOENIX_PAGING_NEW_SCAN_START_ROWKEY_INCLUDE, 
null);
+            } else {
+                if (multiKeyPointLookup != null) {
+                   RegionScanner regionScanner = 
multiKeyPointLookup.getNewScanner();
+                   if (regionScanner == null) {
+                       return false;
+                   }
+                   delegate = regionScanner;
+                }
             }
             if (pagingFilter != null) {
                 pagingFilter.init();
             }
+
             boolean hasMore = raw ? delegate.nextRaw(results) : 
delegate.next(results);
             if (pagingFilter == null) {
-                return hasMore;
+                return multiKeyPointLookup != null ? 
multiKeyPointLookup.hasMore() : hasMore;
             }
             if (!hasMore) {
-                // There is no more row from the HBase region scanner. We need 
to check if PageFilter
-                // has stopped the region scanner
+                // There is no more row from the HBase region scanner. We need 
to check if
+                // PagingFilter has stopped the region scanner
                 if (pagingFilter.isStopped()) {
                     if (results.isEmpty()) {
                         byte[] rowKey = 
pagingFilter.getCurrentRowKeyToBeExcluded();
                         LOGGER.info("Page filter stopped, generating dummy key 
{} ",
                                 Bytes.toStringBinary(rowKey));
                         ScanUtil.getDummyResult(rowKey, results);
+                        if (multiKeyPointLookup != null) {
+                            multiKeyPointLookup.lastDummyCell = results.get(0);
+                            multiKeyPointLookup.lookupPosition--;
+                        }
+                        return true;

Review Comment:
   Got it, this would be good point to add comment here?



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

Reply via email to