rdblue commented on code in PR #4863:
URL: https://github.com/apache/iceberg/pull/4863#discussion_r884323776


##########
core/src/main/java/org/apache/iceberg/util/Tasks.java:
##########
@@ -570,7 +584,7 @@ public static <I> Builder<I> foreach(I... items) {
   }
 
   public static <I> Builder<I> foreach(Stream<I> items) {
-    return new Builder<>(items::iterator);
+    return new Builder<>(items.iterator());

Review Comment:
   I think a better fix is to introduce a one-time use `Iterable` that enforces 
`hasStarted` internally. That way we don't need to modify the code in `Tasks`, 
which is a much larger risk.



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