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,11 +268,10 @@ 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());
long timestampOfLimitRow = srv.getFirstEventTimestamp(scanQuery.getResultFormat());
for (SegmentDescriptor descriptor : descriptorsOrdered) {
if (descriptor.getInterval().contains(timestampOfLimitRow)) {
finalInterval = descriptor.getInterval();
@ -282,6 +281,8 @@ public class ScanQueryRunnerFactory implements QueryRunnerFactory<ScanResultValu
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())));