mayursrivastava commented on a change in pull request #3148:
URL: https://github.com/apache/iceberg/pull/3148#discussion_r712978161



##########
File path: 
arrow/src/main/java/org/apache/iceberg/arrow/vectorized/ArrowReader.java
##########
@@ -308,7 +307,11 @@ public boolean hasNext() {
 
     @Override
     public ColumnarBatch next() {
-      return current;
+      if (hasNext()) {
+        return currentIterator.next();

Review comment:
       I'm following the pattern in 
https://github.com/apache/iceberg/blob/90225d6c9413016d611e2ce5eff37db1bc1b4fc5/api/src/main/java/org/apache/iceberg/io/CloseableIterable.java#L204.
 
   
   Initializing currentIterator is not the only thing that needs to be done, we 
need to keep creating new currentIterator on every new data file. We can move 
the common logic to another method but it will be same logic as hasNext() and I 
don't see any real benefit in moving the code. 
   
   Do you have something in mind that will improve the logic?




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