danny0405 commented on code in PR #9455:
URL: https://github.com/apache/hudi/pull/9455#discussion_r1297898775


##########
hudi-common/src/main/java/org/apache/hudi/io/storage/HoodieAvroHFileReader.java:
##########
@@ -204,7 +212,9 @@ protected ClosableIterator<IndexedRecord> 
getIndexedRecordIterator(Schema reader
     } catch (IOException e) {
       throw new HoodieIOException("Instantiation HfileScanner failed for " + 
reader.getHFileInfo().toString());
     }
-    return new RecordIterator(scanner, getSchema(), readerSchema);
+    RecordIterator iterator = new RecordIterator(scanner, getSchema(), 
readerSchema);
+    recordIterators.add(iterator);

Review Comment:
   Shouldn't these iterators be closed by the caller, we should check every 
invocation of the method and make sure the iterator got closed.
   
   Keepping all the references of the iterators is not a elegant way, maybe 
here we want to support multiple iterators on one reader, and want to reuse the 
reader each time, instead we should instantiate a new reader for each iterator.



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

Reply via email to