vrozov commented on issue #272: Refactor AvroIterable and prevent multiple 
iterators
URL: https://github.com/apache/incubator-iceberg/pull/272#issuecomment-510716849
 
 
   iceberg already violated the common assumption about iterator in two ways
   1. `Iterator` returned by the `iterator()` is "usually" (personally I don't 
know any) not `Closeable` as the primary use case for the `iterator()` method 
is "for-each loop", so making `Iterator` `Closeable` is not well justified as 
`close()` is not called in "for-each loop".
   1. `AvroReuseIterator` always returns the same reference in the `next()` 
method. This is a much bigger "violation" of a common `Iterator` behavior.
   
   I do not say that I see a problem with those "violations" and I see why 
those approaches were taken, but I don't see why it is a problem to introduce 
`Iterable` that allows only single `iterator()` in favor of less error-prone 
code and that does not break any existing assumptions in iceberg.

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

Reply via email to