YuweiXiao commented on a change in pull request #4540:
URL: https://github.com/apache/hudi/pull/4540#discussion_r781702301



##########
File path: 
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/utils/HoodieRealtimeInputFormatUtils.java
##########
@@ -94,16 +94,16 @@
         HoodieTableMetaClient metaClient = 
partitionsToMetaClient.get(partitionPath);
         if (!fsCache.containsKey(metaClient)) {
           HoodieLocalEngineContext engineContext = new 
HoodieLocalEngineContext(conf);
-          HoodieTableFileSystemView fsView = 
FileSystemViewManager.createInMemoryFileSystemView(engineContext,
-              metaClient, HoodieInputFormatUtils.buildMetadataConfig(conf));
+          HoodieTableFileSystemView fsView = 
FileSystemViewManager.createInMemoryFileSystemViewWithTimeline(engineContext,
+              metaClient, HoodieInputFormatUtils.buildMetadataConfig(conf), 
metaClient.getActiveTimeline());
           fsCache.put(metaClient, fsView);
         }
         HoodieTableFileSystemView fsView = fsCache.get(metaClient);
 
         String relPartitionPath = FSUtils.getRelativePartitionPath(new 
Path(metaClient.getBasePath()), partitionPath);
         // Both commit and delta-commits are included - pick the latest 
completed one
         Option<HoodieInstant> latestCompletedInstant =
-            
metaClient.getActiveTimeline().getCommitsTimeline().filterCompletedInstants().lastInstant();
+            
metaClient.getActiveTimeline().getWriteTimeline().filterCompletedInstants().lastInstant();

Review comment:
       It won't affect the correctness. The `latestCompletedInstant` is used to 
filter file slice. Considering a compaction only case, without including the 
completed compaction instant, we will end up reading 'old version' file slice 
(i.e., base file + log) rather than the compacted one (i.e., only base file, 
which has better performance).




-- 
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-unsubscr...@hudi.apache.org

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


Reply via email to