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

nastra 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 51d381bbb3 API: Fix struct metrics in nested struct evaluator test 
(#17412)
51d381bbb3 is described below

commit 51d381bbb33e9742d59ac3735a0bbbb5f79422e4
Author: Eduard Tudenhoefner <[email protected]>
AuthorDate: Sat Aug 1 09:13:04 2026 +0200

    API: Fix struct metrics in nested struct evaluator test (#17412)
    
    `FILE_6` in `TestInclusiveMetricsEvaluator` carried value and null counts 
for the
    `required_address` and `optional_address` structs. Parquet produces metrics 
for leaf
    columns only in `ParquetMetrics.MetricsVisitor.struct` and returns just the 
concatenation of
    its children and never emits a `FieldMetrics` for the struct — so no 
Parquet file yields
    those entries. They made `notNull("optional_address")` appear prunable when 
in practice it is not
---
 .../apache/iceberg/expressions/TestInclusiveMetricsEvaluator.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/api/src/test/java/org/apache/iceberg/expressions/TestInclusiveMetricsEvaluator.java
 
b/api/src/test/java/org/apache/iceberg/expressions/TestInclusiveMetricsEvaluator.java
index eb00a1b6fe..e21e69fa59 100644
--- 
a/api/src/test/java/org/apache/iceberg/expressions/TestInclusiveMetricsEvaluator.java
+++ 
b/api/src/test/java/org/apache/iceberg/expressions/TestInclusiveMetricsEvaluator.java
@@ -210,9 +210,9 @@ public class TestInclusiveMetricsEvaluator {
           Row.of(),
           10,
           // any value counts, including nulls
-          ImmutableMap.of(100, 5L, 101, 5L, 102, 5L, 103, 5L, 104, 5L, 105, 
5L),
+          ImmutableMap.of(102, 5L, 103, 5L, 104, 5L, 105, 5L),
           // null value counts
-          ImmutableMap.of(100, 0L, 101, 5L, 103, 5L, 104, 5L, 105, 5L),
+          ImmutableMap.of(103, 5L, 104, 5L, 105, 5L),
           // nan value counts
           null,
           // lower bounds
@@ -921,7 +921,7 @@ public class TestInclusiveMetricsEvaluator {
     // read optional_address and its nested fields
     shouldRead =
         new InclusiveMetricsEvaluator(NESTED_SCHEMA, 
isNull("optional_address")).eval(FILE_6);
-    assertThat(shouldRead).as("Should read: optional_address is 
optional").isTrue();
+    assertThat(shouldRead).as("Should read: metrics are not tracked for 
structs").isTrue();
 
     shouldRead =
         new InclusiveMetricsEvaluator(NESTED_SCHEMA, 
isNull("optional_address.required_street2"))
@@ -958,7 +958,7 @@ public class TestInclusiveMetricsEvaluator {
     // read optional_address and its nested fields
     shouldRead =
         new InclusiveMetricsEvaluator(NESTED_SCHEMA, 
notNull("optional_address")).eval(FILE_6);
-    assertThat(shouldRead).as("Should not read: optional_address is 
optional").isFalse();
+    assertThat(shouldRead).as("Should read: metrics are not tracked for 
structs").isTrue();
 
     shouldRead =
         new InclusiveMetricsEvaluator(NESTED_SCHEMA, 
notNull("optional_address.required_street2"))

Reply via email to