nsivabalan commented on code in PR #18015:
URL: https://github.com/apache/hudi/pull/18015#discussion_r2744258621
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/bloom/ListBasedHoodieBloomIndexHelper.java:
##########
@@ -67,10 +66,9 @@ public HoodiePairData<HoodieKey, HoodieRecordLocation>
findMatchingFilesForRecor
CollectionUtils.toStream(
new HoodieBloomIndexCheckFunction<Pair<HoodieFileGroupId,
String>>(hoodieTable, config, Pair::getLeft, Pair::getRight)
.apply(fileComparisonPairList.iterator())
- )
- .flatMap(Collection::stream)
- .filter(lr -> lr.getMatchingRecordKeysAndPositions().size() > 0)
- .collect(toList());
+ )
+ .filter(lr -> lr.getMatchingRecordKeysAndPositions().size() > 0)
Review Comment:
can we do `!lr.getMatchingRecordKeysAndPositions().isEmpty()`
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/bloom/HoodieBloomIndexCheckFunction.java:
##########
@@ -63,26 +60,30 @@ public HoodieBloomIndexCheckFunction(HoodieTable
hoodieTable,
}
@Override
- public Iterator<List<HoodieKeyLookupResult>> apply(Iterator<I>
fileGroupIdRecordKeyPairIterator) {
+ public Iterator<HoodieKeyLookupResult> apply(Iterator<I>
fileGroupIdRecordKeyPairIterator) {
return new LazyKeyCheckIterator(fileGroupIdRecordKeyPairIterator);
}
- protected class LazyKeyCheckIterator extends LazyIterableIterator<I,
List<HoodieKeyLookupResult>> {
+ protected class LazyKeyCheckIterator implements
Iterator<HoodieKeyLookupResult> {
- private HoodieKeyLookupHandle keyLookupHandle;
+ private final Iterator<I> filePartitionRecordKeyTripletItr;
+ private HoodieKeyLookupHandle keyLookupHandle = null;
LazyKeyCheckIterator(Iterator<I> filePartitionRecordKeyTripletItr) {
- super(filePartitionRecordKeyTripletItr);
+ this.filePartitionRecordKeyTripletItr = filePartitionRecordKeyTripletItr;
Review Comment:
minor. in L64 we name this as pairIterator, and here we are naming it as
TripleItr. can we align the naming.
--
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]