nastra commented on a change in pull request #2933:
URL: https://github.com/apache/iceberg/pull/2933#discussion_r683203484



##########
File path: 
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/ArrowReader.java
##########
@@ -252,17 +297,10 @@ public boolean hasNext() {
         }
       } catch (IOException | RuntimeException e) {
         if (currentTask != null && !currentTask.isDataTask()) {
-          throw new RuntimeException(

Review comment:
       while reviewing this part of the PR, I noticed that `hasNext` isn't 
idempotent, meaning that if you call `hasNext` multiple times, it will actually 
advance the pointer and IMO this kind of logic should only happen inside `next` 
and not `hasNext`.
   
   I also wonder why we need to catch exceptions in a `hasNext` method, so 
maybe this is something that can be improved in a follow-up?




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