hililiwei commented on code in PR #4325:
URL: https://github.com/apache/iceberg/pull/4325#discussion_r1130985815
##########
data/src/main/java/org/apache/iceberg/data/TableMigrationUtil.java:
##########
@@ -107,8 +176,13 @@ public static List<DataFile> listPartition(
.filter(FileStatus::isFile)
.collect(Collectors.toList());
DataFile[] datafiles = new DataFile[fileStatus.size()];
- Tasks.Builder<Integer> task =
-
Tasks.range(fileStatus.size()).stopOnFailure().throwFailureWhenFinished();
+ Tasks.Builder<Integer> task = Tasks.range(fileStatus.size());
+
+ if (skipOnError) {
+ task.suppressFailureWhenFinished();
Review Comment:
If we need to skip based on specific failures, I prefer to add a method to
`Tasks` that specifies which exceptions can be skipped, such as:
```
public final Builder<I> skipOn(Class<? extends Exception>... exceptions)
{
this.skipExceptions = Lists.newArrayList(exceptions);
return this;
}
```
In this way, we can use it like this:
```
Tasks.foreach(xxxx)
.skipOn(ClassCastException.class, ParquetDecodingException .class)
.……
.run()
```
What do you think of this?
--
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]