You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/06/25 00:33:24 UTC

[GitHub] [hudi] danny0405 commented on a diff in pull request #5953: [WIP][HUDI-4314] Improve the performance of reading from the specified ins…

danny0405 commented on code in PR #5953:
URL: https://github.com/apache/hudi/pull/5953#discussion_r906609490


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/source/IncrementalInputSplits.java:
##########
@@ -216,11 +220,29 @@ public Result inputSplits(
     final String endInstant = instantToIssue.getTimestamp();
     final AtomicInteger cnt = new AtomicInteger(0);
     final String mergeType = this.conf.getString(FlinkOptions.MERGE_TYPE);
+    final FileSystem fs = FSUtils.getFs(path.toString(), hadoopConf);
     List<MergeOnReadInputSplit> inputSplits = writePartitions.stream()
         .map(relPartitionPath -> fsView.getLatestMergedFileSlicesBeforeOrOn(relPartitionPath, endInstant)
+            .filter(fileSlice -> {
+              Option<String> basePath = fileSlice.getBaseFile().map(BaseFile::getPath);
+              try {
+                return basePath.isPresent() && fs.exists(new org.apache.hadoop.fs.Path(basePath.get()));
+              } catch (IOException e) {
+                LOG.error("Checking exists of base path: {} error", basePath);

Review Comment:
   Can we write a tool method for `FileSlice` by checking file existence by filtering out the non-exist files together ? Maybe name it `filterFileSliceWithValidFiles`



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org