You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/04/21 04:04:00 UTC

[jira] [Updated] (HUDI-6120) Streaming read will read basefile even if skipBaseFiles is set to true

     [ https://issues.apache.org/jira/browse/HUDI-6120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated HUDI-6120:
---------------------------------
    Labels: pull-request-available  (was: )

> Streaming read will read basefile even if skipBaseFiles is set to true
> ----------------------------------------------------------------------
>
>                 Key: HUDI-6120
>                 URL: https://issues.apache.org/jira/browse/HUDI-6120
>             Project: Apache Hudi
>          Issue Type: Improvement
>            Reporter: Jianhui Dong
>            Priority: Major
>              Labels: pull-request-available
>
> Check the code snippet of org.apache.hudi.common.table.view.AbstractTableFileSystemView#fetchAllLogsMergedFileSlice:
> {code:java}
> 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);
> }{code}
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)