n3nash commented on a change in pull request #689: [HUDI-25] Optimize 
HoodieInputFormat.listStatus for faster Hive Incremental queries
URL: https://github.com/apache/incubator-hudi/pull/689#discussion_r289985197
 
 

 ##########
 File path: 
hoodie-hadoop-mr/src/main/java/com/uber/hoodie/hadoop/HoodieInputFormat.java
 ##########
 @@ -218,4 +215,109 @@ protected static HoodieTableMetaClient 
getTableMetaClient(FileSystem fs, Path da
     LOG.info("Reading hoodie metadata from path " + baseDir.toString());
     return new HoodieTableMetaClient(fs.getConf(), baseDir.toString());
   }
+
+  /**
+   * Achieves listStatus functionality for an incrementally queried table. 
Instead of listing all
+   * partitions and then filtering based on the commits of interest, this 
logic first extracts the
+   * partitions touched by the desired commits and then lists only those 
partitions.
+   */
+  private List<FileStatus> listStatusForIncrementalMode(JobConf job,
+      HoodieTableMetaClient tableMetaClient, List<Path> inputPaths) throws 
IOException {
+    String tableName = tableMetaClient.getTableConfig().getTableName();
+    HoodieTimeline timeline = 
tableMetaClient.getActiveTimeline().getCommitsTimeline()
 
 Review comment:
   HoodieInputFormat supports only RO based tables, which means we should use 
tableMetaClient.getActiveTimeline().getCommitTimeline() instead of 
tableMetaClient.getActiveTimeline().getCommitsTimeline(). But that brings 
another question, what is the plan for HoodieRealtimeInputFormat ? Are we 
planning to do similar optimizations there ?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to