clairemcginty commented on code in PR #1328:
URL: https://github.com/apache/parquet-java/pull/1328#discussion_r1613495538


##########
parquet-column/src/main/java/org/apache/parquet/internal/column/columnindex/ColumnIndexBuilder.java:
##########
@@ -368,6 +369,102 @@ public <T extends Comparable<T>> PrimitiveIterator.OfInt 
visit(NotIn<T> notIn) {
       return IndexIterator.all(getPageCount());
     }
 
+    @Override
+    public <T extends Comparable<T>> PrimitiveIterator.OfInt visit(Contains<T> 
contains) {
+      return contains.filter(
+          this,
+          // For Contains.And, compute the intersection of the int ranges
+          (l, r) -> new PrimitiveIterator.OfInt() {
+            private Integer next = null;
+
+            @Override
+            public int nextInt() {
+              int result = next;
+              next = null;
+              return result;
+            }

Review Comment:
   makes sense! I had put some of the next-loading logic into `hasNext()` 
because as far as I could tell, this iterator would be used via the 
`forEachRemaining()` method, which IIRC does sequentially call 
`hasNext()/next()`... but it does make this a bit unstable 😅 I can rewrite it 
and move into static methods in `IndexIterator`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to