From 2db73998b903d877364966c805f910138ceb0e3d Mon Sep 17 00:00:00 2001 From: fjy Date: Mon, 10 Mar 2014 12:01:49 -0700 Subject: [PATCH] add fix for II --- .../IncrementalIndexStorageAdapter.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/processing/src/main/java/io/druid/segment/incremental/IncrementalIndexStorageAdapter.java b/processing/src/main/java/io/druid/segment/incremental/IncrementalIndexStorageAdapter.java index 8843879f91b..878b79682e9 100644 --- a/processing/src/main/java/io/druid/segment/incremental/IncrementalIndexStorageAdapter.java +++ b/processing/src/main/java/io/druid/segment/incremental/IncrementalIndexStorageAdapter.java @@ -241,19 +241,17 @@ public class IncrementalIndexStorageAdapter implements StorageAdapter if (numAdvanced == -1) { numAdvanced = 0; - while (baseIter.hasNext()) { - currEntry.set(baseIter.next()); - if (filterMatcher.matches()) { - return; - } - - numAdvanced++; - } } else { Iterators.advance(baseIter, numAdvanced); - if (baseIter.hasNext()) { - currEntry.set(baseIter.next()); + } + + while (baseIter.hasNext()) { + currEntry.set(baseIter.next()); + if (filterMatcher.matches()) { + return; } + + numAdvanced++; } done = cursorMap.size() == 0 || !baseIter.hasNext();