danny0405 commented on code in PR #9455:
URL: https://github.com/apache/hudi/pull/9455#discussion_r1297898113
##########
hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieHFileDataBlock.java:
##########
@@ -193,15 +212,33 @@ protected <T> ClosableIterator<HoodieRecord<T>>
lookupRecords(List<String> sorte
blockContentLoc.getContentPositionInLogFile(),
blockContentLoc.getBlockSize());
- final HoodieAvroHFileReader reader =
+ HoodieAvroHFileReader reader =
new HoodieAvroHFileReader(inlineConf, inlinePath, new
CacheConfig(inlineConf), inlinePath.getFileSystem(inlineConf),
Option.of(getSchemaFromHeader()));
// Get writer's schema from the header
final ClosableIterator<HoodieRecord<IndexedRecord>> recordIterator =
fullKey ? reader.getRecordsByKeysIterator(sortedKeys, readerSchema) :
reader.getRecordsByKeyPrefixIterator(sortedKeys, readerSchema);
- return new CloseableMappingIterator<>(recordIterator, data ->
(HoodieRecord<T>) data);
+ ClosableIterator<HoodieRecord<IndexedRecord>> iterator = new
ClosableIterator<HoodieRecord<IndexedRecord>>() {
+ @Override
+ public void close() {
+ recordIterator.close();
+ reader.close();
Review Comment:
ditto
--
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]