dramaticlly commented on code in PR #17391:
URL: https://github.com/apache/iceberg/pull/17391#discussion_r3667456931


##########
core/src/test/java/org/apache/iceberg/FileGenerationUtil.java:
##########
@@ -207,6 +211,44 @@ public static Metrics generateRandomMetrics(
         originalTypes);
   }
 
+  // collects leaf primitive fields, recursing through struct/list/map
+  static List<Types.NestedField> leafFields(Schema schema) {
+    List<Types.NestedField> leaves = Lists.newArrayList();
+    TypeUtil.visit(
+        schema,
+        new TypeUtil.SchemaVisitor<Void>() {

Review Comment:
   I think current behavior for leafFields will throw 
UnsupportedOperationException if running into a V3 table with variant type. To 
me, it seems reasonable as exception serve as a reminder to add variant support 
later. There's also change like #15629 to add dedicated benchmark for variant.
   
   Prefer to keep the existing scope and revisit v3+ type later in follow up PR



##########
core/src/test/java/org/apache/iceberg/TestFileGenerationUtil.java:
##########
@@ -101,12 +115,32 @@ void testBoundsForAllMetricsModes(String metricsMode) {
             ImmutableMap.of() /* no lower bounds */,
             ImmutableMap.of() /* no upper bounds */);
 
-    checkBounds(metrics, metricsConfig);
+    checkBounds(SCHEMA, metrics, metricsConfig);
+  }
+
+  @Test
+  public void testBoundsForNestedTypes() {
+    MetricsConfig metricsConfig = MetricsConfig.getDefault();

Review Comment:
   Good call, parametrized on all metrics mode for better coverage



-- 
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