vrozov commented on issue #272: Refactor AvroIterable and prevent multiple iterators URL: https://github.com/apache/incubator-iceberg/pull/272#issuecomment-509788653 @rdblue While iterators returned by `AvroIterable.iterator()` are `Closeable`, they are unlikely to be closed. In your example, it is `AvroIterable.close()` that closes `Iterator` that java implicitly obtains from `records` and there is no implicit or explicit call to the iterator `close()` method. In `ParallelIterable` it is Iterable that is closed (assuming that you refer to https://github.com/vrozov/incubator-iceberg/blob/master/core/src/main/java/org/apache/iceberg/util/ParallelIterable.java#L63) not the iterator. The PR prevents constructs like ``` try (AvroIterable records = Avro.read(...).build()) { for (R record : records) { ... } for (R record : records) { // <-not allowed ... } } ```
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
