openinx commented on a change in pull request #2989: URL: https://github.com/apache/iceberg/pull/2989#discussion_r701750871
########## 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>> result = Maps.newHashMap(); + List<ManifestFile> manifestFiles = table.currentSnapshot().dataManifests(); + for (ManifestFile manifestFile : manifestFiles) { + try (ManifestReader<DataFile> reader = ManifestFiles.read(manifestFile, table.io())) { + List<DataFile> dataFiles = IteratorUtils.toList(reader.iterator()); Review comment: I see a warning in IDE here, using the `Lists.newArrayList(reader)` could fix the warning. -- 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-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org