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



##########
File path: flink/src/test/java/org/apache/iceberg/flink/SimpleDataUtil.java
##########
@@ -259,4 +265,37 @@ public static StructLikeSet actualRowSet(Table table, Long 
snapshotId, String...
 
     return dataFiles;
   }
+
+  public static Map<Long, List<DataFile>> snapshotToDataFiles(
+      Table table)
+      throws IOException {
+    table.refresh();
+    Map<Long, List<DataFile>> res = Maps.newHashMap();
+    List<ManifestFile> manifestFiles = table.currentSnapshot().allManifests();
+    for (ManifestFile mf : manifestFiles) {
+      try (ManifestReader<DataFile> reader = ManifestFiles.read(mf, 
table.io())) {
+        List<DataFile> dataFiles = IteratorUtils.toList(reader.iterator());
+        if (res.containsKey(mf.snapshotId())) {
+          res.get(mf.snapshotId()).addAll(dataFiles);
+        } else {
+          res.put(mf.snapshotId(), dataFiles);
+        }
+      }
+    }
+    return res;
+  }
+
+  public static List<DataFile> matchingPartitions(
+      List<DataFile> dataFiles, PartitionSpec partitionSpec, Map<String, 
Object> partitionValues) {
+    Types.StructType spec = partitionSpec.partitionType();

Review comment:
       nit: spec -> partitionType




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