diff --git a/processing/src/main/java/org/apache/druid/collections/bitmap/BatchIteratorAdapter.java b/processing/src/main/java/org/apache/druid/collections/bitmap/BatchIteratorAdapter.java index 225999f02c07d..fa5e6d996426e 100644 --- a/processing/src/main/java/org/apache/druid/collections/bitmap/BatchIteratorAdapter.java +++ b/processing/src/main/java/org/apache/druid/collections/bitmap/BatchIteratorAdapter.java @@ -25,11 +25,11 @@ public final class BatchIteratorAdapter implements BatchIterator { - private final IntIterator iterator; + private final PeekableIteratorAdapter iterator; public BatchIteratorAdapter(IntIterator iterator) { - this.iterator = Preconditions.checkNotNull(iterator, "iterator"); + this.iterator = new PeekableIteratorAdapter<>(Preconditions.checkNotNull(iterator, "iterator")); } @Override @@ -49,6 +49,12 @@ public boolean hasNext() return iterator.hasNext(); } + @Override + public void advanceIfNeeded(int target) + { + iterator.advanceIfNeeded(target); + } + @Override public BatchIterator clone() {