stevenzwu commented on a change in pull request #2275:
URL: https://github.com/apache/iceberg/pull/2275#discussion_r643670494



##########
File path: api/src/test/java/org/apache/iceberg/TestHelpers.java
##########
@@ -120,6 +120,22 @@ public static void assertSerializedAndLoadedMetadata(Table 
expected, Table actua
     Assert.assertEquals("History must match", expected.history(), 
actual.history());
   }
 
+  public static void assertSameSchemaMap(Map<Integer, Schema> map1, 
Map<Integer, Schema> map2) {
+    if (map1.size() != map2.size()) {
+      Assert.fail("Should have same number of schemas in both maps");
+    }
+
+    map1.forEach((schemaId, schema1) -> {
+      Schema schema2 = map2.get(schemaId);
+      Assert.assertNotNull(String.format("Schema ID %s does not exist in map: 
%s", schemaId, map2), schema2);
+
+      Assert.assertEquals("Should have matching schema id",
+          schema1.schemaId(), schema2.schemaId());
+      Assert.assertEquals("Should have matching schema struct",

Review comment:
       should we use `Schema#sameSchema`?




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

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