rdblue commented on code in PR #4863:
URL: https://github.com/apache/iceberg/pull/4863#discussion_r885054622
##########
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:
No, `stream::iterator` will allow calling `iterator` more than once. Adding
a single-use iterable would fix this without lots of code changes.
--
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]