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


##########
hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieHFileDataBlock.java:
##########
@@ -175,7 +175,26 @@ protected <T> ClosableIterator<HoodieRecord<T>> 
deserializeRecords(byte[] conten
     FileSystem fs = FSUtils.getFs(pathForReader.toString(), 
FSUtils.buildInlineConf(getBlockContentLocation().get().getHadoopConf()));
     // Read the content
     HoodieAvroHFileReader reader = new HoodieAvroHFileReader(fs, 
pathForReader, content, Option.of(getSchemaFromHeader()));
-    return unsafeCast(reader.getRecordIterator(readerSchema));
+
+    ClosableIterator<HoodieRecord<IndexedRecord>> recordIterator = 
reader.getRecordIterator(readerSchema);
+    ClosableIterator<HoodieRecord<IndexedRecord>> iterator = new 
ClosableIterator<HoodieRecord<IndexedRecord>>() {
+      @Override
+      public void close() {
+        recordIterator.close();
+        reader.close();

Review Comment:
   Isn't the `recordIterator.close()` just closing the reader? What nested in 
another 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