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


##########
parquet-hadoop/src/main/java/org/apache/parquet/filter2/statisticslevel/StatisticsFilter.java:
##########
@@ -217,6 +219,70 @@ public <T extends Comparable<T>> Boolean visit(Contains<T> 
contains) {
     return contains.filter(this, (l, r) -> l || r, (l, r) -> l && r, v -> 
BLOCK_MIGHT_MATCH);
   }
 
+  @Override
+  public Boolean visit(Size size) {
+    final ColumnChunkMetaData metadata = 
getColumnChunk(size.getColumn().getColumnPath());
+    if (metadata == null) {
+      // the column isn't in this file, so fail eq/gt/gte targeting size > 0
+      final boolean blockCannotMatch =
+          size.filter((eq) -> eq > 0, (lt) -> false, (lte) -> false, (gt) -> 
gt >= 0, (gte) -> gte > 0);
+      return blockCannotMatch ? BLOCK_CANNOT_MATCH : BLOCK_MIGHT_MATCH;
+    }
+
+    final SizeStatistics stats = metadata.getSizeStatistics();

Review Comment:
   We could also offer _only_ record-level filtering 
(`IncrementallyUpdatedFilterPredicate`) for 2-level and unannotated lists, 
since that doesn't depend on any particular list implementation. We'd just skip 
StatisticsFilter/BloomFilter/DictionaryFilter/ColumnIndexFilter. That way 
`size()` would still work for any kind of list--it would just be less less 
efficient. 



-- 
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: issues-unsubscr...@parquet.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@parquet.apache.org
For additional commands, e-mail: issues-h...@parquet.apache.org

Reply via email to