stevenzwu commented on code in PR #13941:
URL: https://github.com/apache/iceberg/pull/13941#discussion_r2316566955
##########
spark/v4.0/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewriteDataFilesAction.java:
##########
@@ -2140,8 +2141,10 @@ protected void shouldHaveMultipleFiles(Table table) {
protected void shouldHaveFiles(Table table, int numExpected) {
table.refresh();
- int numFiles = Iterables.size(table.newScan().planFiles());
- assertThat(numFiles).as("Did not have the expected number of
files").isEqualTo(numExpected);
+ List<FileScanTask> files =
+ StreamSupport.stream(table.newScan().planFiles().spliterator(), false)
+ .collect(Collectors.toList());
+ assertThat(files.size()).as("Did not have the expected number of
files").isEqualTo(numExpected);
Review Comment:
Nit: I thought below is the preferred assertion style with better error msg
```
assertThat(files).as("Did not have the expected number of
files").hasSize(numExpected);
```
--
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]