You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by hu...@apache.org on 2026/08/03 21:51:31 UTC

(iceberg) branch main updated: Parquet: Extract nested/variant type check in ParquetMetricsRowGroupFilter (#17377)

This is an automated email from the ASF dual-hosted git repository.

huaxingao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/main by this push:
     new 58d5c3704f Parquet: Extract nested/variant type check in ParquetMetricsRowGroupFilter (#17377)
58d5c3704f is described below

commit 58d5c3704f1ea55a38383d10e2bfbb947d968b3f
Author: Uros Bojanic <22...@users.noreply.github.com>
AuthorDate: Mon Aug 3 23:51:25 2026 +0200

    Parquet: Extract nested/variant type check in ParquetMetricsRowGroupFilter (#17377)
    
    * Parquet: Extract nested/variant type check in ParquetMetricsRowGroupFilter
    
    * Address comments
---
 .../iceberg/parquet/ParquetMetricsRowGroupFilter.java      | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/parquet/src/main/java/org/apache/iceberg/parquet/ParquetMetricsRowGroupFilter.java b/parquet/src/main/java/org/apache/iceberg/parquet/ParquetMetricsRowGroupFilter.java
index 0cf4aa2a36..c1a835545a 100644
--- a/parquet/src/main/java/org/apache/iceberg/parquet/ParquetMetricsRowGroupFilter.java
+++ b/parquet/src/main/java/org/apache/iceberg/parquet/ParquetMetricsRowGroupFilter.java
@@ -189,8 +189,7 @@ public class ParquetMetricsRowGroupFilter {
       // When filtering nested types or variant types, notNull() is an implicit filter passed
       // even though complex filters aren't pushed down in Parquet. Leave these type filters
       // to be evaluated post scan.
-      Type type = schema.findType(id);
-      if (type instanceof Type.NestedType || type.isVariantType()) {
+      if (isNestedOrVariantType(id)) {
         return ROWS_MIGHT_MATCH;
       }
 
@@ -359,8 +358,7 @@ public class ParquetMetricsRowGroupFilter {
 
       // Leave all nested column type and variant type filters to be
       // evaluated post scan.
-      Type type = schema.findType(id);
-      if (type instanceof Type.NestedType || type.isVariantType()) {
+      if (isNestedOrVariantType(id)) {
         return ROWS_MIGHT_MATCH;
       }
 
@@ -409,8 +407,7 @@ public class ParquetMetricsRowGroupFilter {
 
       // Leave all nested column type and variant type filters to be
       // evaluated post scan.
-      Type type = schema.findType(id);
-      if (type instanceof Type.NestedType || type.isVariantType()) {
+      if (isNestedOrVariantType(id)) {
         return ROWS_MIGHT_MATCH;
       }
 
@@ -595,6 +592,11 @@ public class ParquetMetricsRowGroupFilter {
     public <T> Boolean handleNonReference(Bound<T> term) {
       return ROWS_MIGHT_MATCH;
     }
+
+    private boolean isNestedOrVariantType(int id) {
+      Type type = schema.findType(id);
+      return type instanceof Type.NestedType || type.isVariantType();
+    }
   }
 
   /**