mxm commented on code in PR #18302:
URL: https://github.com/apache/iceberg/pull/18302#discussion_r4131784299


##########
core/src/test/java/org/apache/iceberg/TestStatsUtil.java:
##########
@@ -564,6 +564,17 @@ public void testContentStatsWriteSchemaOmitsListAndMap() {
     assertThat(actual.fields()).isEmpty();
   }
 
+  private static void assertSameTopLevelFieldsInAnyOrder(
+      Types.StructType expected, Types.StructType actual) {
+    assertThat(actual.fields()).as("Number of 
fields").hasSameSizeAs(expected.fields());
+
+    for (Types.NestedField expectedField : expected.fields()) {
+      Types.NestedField actualField = actual.field(expectedField.fieldId());
+      assertThat(actualField).as("Field ID %s", 
expectedField.fieldId()).isNotNull();
+      assertSameStructure(Types.StructType.of(expectedField), 
Types.StructType.of(actualField));
+    }
+  }
+

Review Comment:
   Do we need this? Can't we simply sort `actual` / `expected` by field id? We 
should probably make that change in the existing `assertSameStructure`.



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