@@ -511,8 +511,7 @@ public boolean next(List<Cell> outResult, ScannerContext scannerContext) throws
511
511
// If no limits exists in the scope LimitScope.Between_Cells then we are sure we are changing
512
512
// rows. Else it is possible we are still traversing the same row so we must perform the row
513
513
// comparison.
514
- if (!scannerContext .hasAnyLimit (LimitScope .BETWEEN_CELLS ) || matcher .row == null ||
515
- !Bytes .equals (row , offset , length , matcher .row , matcher .rowOffset , matcher .rowLength )) {
514
+ if (!scannerContext .hasAnyLimit (LimitScope .BETWEEN_CELLS ) || matcher .row == null ) {
516
515
this .countPerRow = 0 ;
517
516
matcher .setRow (row , offset , length );
518
517
}
@@ -560,6 +559,10 @@ public boolean next(List<Cell> outResult, ScannerContext scannerContext) throws
560
559
if (!matcher .moreRowsMayExistAfter (cell )) {
561
560
return scannerContext .setScannerState (NextState .NO_MORE_VALUES ).hasMoreValues ();
562
561
}
562
+ // Setting the matcher.row = null, will mean that after the subsequent seekToNextRow()
563
+ // the heap.peek() will any way be in the next row. So the SQM.match(cell) need do
564
+ // another compareRow to say the current row is DONE
565
+ matcher .row = null ;
563
566
seekToNextRow (cell );
564
567
break LOOP ;
565
568
}
@@ -587,6 +590,10 @@ public boolean next(List<Cell> outResult, ScannerContext scannerContext) throws
587
590
if (!matcher .moreRowsMayExistAfter (cell )) {
588
591
return scannerContext .setScannerState (NextState .NO_MORE_VALUES ).hasMoreValues ();
589
592
}
593
+ // Setting the matcher.row = null, will mean that after the subsequent seekToNextRow()
594
+ // the heap.peek() will any way be in the next row. So the SQM.match(cell) need do
595
+ // another compareRow to say the current row is DONE
596
+ matcher .row = null ;
590
597
seekToNextRow (cell );
591
598
} else if (qcode == ScanQueryMatcher .MatchCode .INCLUDE_AND_SEEK_NEXT_COL ) {
592
599
seekAsDirection (matcher .getKeyForNextColumn (cell ));
@@ -603,6 +610,10 @@ public boolean next(List<Cell> outResult, ScannerContext scannerContext) throws
603
610
continue ;
604
611
605
612
case DONE :
613
+ // We are sure that this row is done and we are in the next row.
614
+ // So subsequent StoresScanner.next() call need not do another compare
615
+ // and set the matcher.row
616
+ matcher .row = null ;
606
617
return scannerContext .setScannerState (NextState .MORE_VALUES ).hasMoreValues ();
607
618
608
619
case DONE_SCAN :
@@ -615,7 +626,10 @@ public boolean next(List<Cell> outResult, ScannerContext scannerContext) throws
615
626
if (!matcher .moreRowsMayExistAfter (cell )) {
616
627
return scannerContext .setScannerState (NextState .NO_MORE_VALUES ).hasMoreValues ();
617
628
}
618
-
629
+ // Setting the matcher.row = null, will mean that after the subsequent seekToNextRow()
630
+ // the heap.peek() will any way be in the next row. So the SQM.match(cell) need do
631
+ // another compareRow to say the current row is DONE
632
+ matcher .row = null ;
619
633
seekToNextRow (cell );
620
634
break ;
621
635
0 commit comments