Fix bug messing up count of rows

This commit is contained in:
Justin Borromeo 2019-03-25 16:15:49 -07:00
parent 219af478c8
commit 35692680fc
1 changed files with 12 additions and 11 deletions

View File

@ -268,20 +268,21 @@ public class ScanQueryRunnerFactory implements QueryRunnerFactory<ScanResultValu
if (q.size() > limit) {
q.poll();
}
}
yielder = yielder.next(null);
// Finish scanning the interval containing the limit row
if (numRowsScanned > limit && finalInterval == null) {
long timestampOfLimitRow = next.getFirstEventTimestamp(scanQuery.getResultFormat());
for (SegmentDescriptor descriptor : descriptorsOrdered) {
if (descriptor.getInterval().contains(timestampOfLimitRow)) {
finalInterval = descriptor.getInterval();
// Finish scanning the interval containing the limit row
if (numRowsScanned > limit && finalInterval == null) {
long timestampOfLimitRow = srv.getFirstEventTimestamp(scanQuery.getResultFormat());
for (SegmentDescriptor descriptor : descriptorsOrdered) {
if (descriptor.getInterval().contains(timestampOfLimitRow)) {
finalInterval = descriptor.getInterval();
}
}
if (finalInterval == null) {
throw new ISE("WTH??? Row came from an unscanned interval?");
}
}
if (finalInterval == null) {
throw new ISE("WTH??? Row came from an unscanned interval?");
}
}
yielder = yielder.next(null);
doneScanning = yielder.isDone() ||
(finalInterval != null &&
!finalInterval.contains(next.getFirstEventTimestamp(scanQuery.getResultFormat())));