Details
-
Improvement
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
None
-
None
Description
Check the code snippet of org.apache.hudi.common.table.view.AbstractTableFileSystemView#fetchAllLogsMergedFileSlice:
private Option<FileSlice> fetchAllLogsMergedFileSlice(HoodieFileGroup fileGroup, String maxInstantTime) { List<FileSlice> fileSlices = fileGroup.getAllFileSlicesBeforeOn(maxInstantTime).collect(Collectors.toList()); if (fileSlices.size() == 0) { return Option.empty(); } if (fileSlices.size() == 1) { return Option.of(fileSlices.get(0)); } final FileSlice latestSlice = fileSlices.get(0); FileSlice merged = new FileSlice(latestSlice.getPartitionPath(), latestSlice.getBaseInstantTime(), latestSlice.getFileId()); // add log files from the latest slice to the earliest fileSlices.forEach(slice -> slice.getLogFiles().forEach(merged::addLogFile)); return Option.of(merged); }
if we only fetch one file slice, we will return the file slice with basefile, and then hudi-flink will create a SkipMergeIterator/MergeIterator which both reads basefile and logfiles for the split.
Attachments
Issue Links
- links to