the-other-tim-brown commented on code in PR #13361:
URL: https://github.com/apache/hudi/pull/13361#discussion_r2114824284
##########
hudi-common/src/main/java/org/apache/hudi/metadata/SecondaryIndexRecordGenerationUtils.java:
##########
@@ -275,25 +198,39 @@ public static HoodieData<HoodieRecord>
readSecondaryKeysFromFileSlices(HoodieEng
} else {
readerSchema = tableSchema;
}
- return createSecondaryIndexGenerator(metaClient, engineType,
logFilePaths, readerSchema, partition, dataFilePath, indexDefinition,
-
metaClient.getActiveTimeline().filterCompletedInstants().lastInstant().map(HoodieInstant::requestedTime).orElse(""));
+ ClosableIterator<Pair<String, String>> secondaryIndexGenerator =
createSecondaryIndexGenerator(readerContextFactory.getContext(), metaClient,
fileSlice, readerSchema, indexDefinition,
+
metaClient.getActiveTimeline().filterCompletedInstants().lastInstant().map(HoodieInstant::requestedTime).orElse(""),
props, false);
+ return new CloseableMappingIterator<>(secondaryIndexGenerator, pair ->
createSecondaryIndexRecord(pair.getKey(), pair.getValue(),
indexDefinition.getIndexName(), false));
});
}
- private static ClosableIterator<HoodieRecord>
createSecondaryIndexGenerator(HoodieTableMetaClient metaClient,
-
EngineType engineType, List<String> logFilePaths,
-
Schema tableSchema, String partition,
-
Option<StoragePath> dataFilePath,
-
HoodieIndexDefinition indexDefinition,
-
String instantTime) throws Exception {
- return new ClosableIterator<HoodieRecord>() {
- private final HoodieFileSliceReader<HoodieRecord> fileSliceReader =
getFileSliceReader(
- metaClient, engineType, logFilePaths, tableSchema, partition,
dataFilePath, instantTime);
- private HoodieRecord nextValidRecord;
+ private static <T> ClosableIterator<Pair<String, String>>
createSecondaryIndexGenerator(HoodieReaderContext<T> readerContext,
Review Comment:
Added doc
--
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]