Skip to content

Commit

Permalink
Fix ColumnIndexBuilder for notIn predicate (apache#961)
Browse files Browse the repository at this point in the history
  • Loading branch information
huaxingao authored May 9, 2022
1 parent fb3a905 commit f2f7c3e
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,17 +344,7 @@ public <T extends Comparable<T>> PrimitiveIterator.OfInt visit(In<T> in) {

@Override
public <T extends Comparable<T>> PrimitiveIterator.OfInt visit(NotIn<T> notIn) {
IntSet indexes = getMatchingIndexes(notIn);
return IndexIterator.filter(getPageCount(), pageIndex -> !indexes.contains(pageIndex));
}

private <T extends Comparable<T>> IntSet getMatchingIndexes(SetColumnFilterPredicate<T> in) {
IntSet matchingIndexes = new IntOpenHashSet();
for (T value : in.getValues()) {
Eq<T> eq = new Eq<>(in.getColumn(), value);
visit(eq).forEachRemaining((IntConsumer) matchingIndexes::add);
}
return matchingIndexes;
return IndexIterator.all(getPageCount());
}

@Override
Expand Down
Loading

0 comments on commit f2f7c3e

Please sign in to comment.