zhangjun0x01 commented on a change in pull request #1765:
URL: https://github.com/apache/iceberg/pull/1765#discussion_r526610168



##########
File path: flink/src/test/java/org/apache/iceberg/flink/SimpleDataUtil.java
##########
@@ -129,11 +129,25 @@ public static void assertTableRows(String tablePath, 
List<RowData> expected) thr
   public static void assertTableRecords(Table table, List<Record> expected) 
throws IOException {
     table.refresh();
     try (CloseableIterable<Record> iterable = 
IcebergGenerics.read(table).build()) {
-      Assert.assertEquals("Should produce the expected record",
-          Sets.newHashSet(expected), Sets.newHashSet(iterable));
+      List<Record> iterList = Lists.newArrayList(iterable.iterator());
+      sortRecordList(iterList);
+      sortRecordList(expected);
+      Assert.assertEquals("Should produce the expected record", expected, 
iterList);
     }
   }
 
+  private static void sortRecordList(List<Record> list) {
+    Collections.sort(list, (o1, o2) -> {

Review comment:
       In order to test the multi-level partition filter, I constructed a 
2-level partition in this method : 
[TestRewriteDataFilesAction#testRewriteDataFilesWithFilter](https://github.com/apache/iceberg/blob/master/flink/src/test/java/org/apache/iceberg/flink/actions/TestRewriteDataFilesAction.java#L190)
 , so each record has three fields. I don’t know if there will be similar test 
cases in the future.




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