You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "mxm (via GitHub)" <gi...@apache.org> on 2026/09/29 09:29:12 UTC
Re: [PR] Core: Make content stats write-schema tests order-independent [iceberg]
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org