bhasudha 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_r287533611
##########
File path:
hoodie-hadoop-mr/src/main/java/com/uber/hoodie/hadoop/HoodieInputFormat.java
##########
@@ -62,65 +66,53 @@
@Override
public FileStatus[] listStatus(JobConf job) throws IOException {
- // Get all the file status from FileInputFormat and then do the filter
- FileStatus[] fileStatuses = super.listStatus(job);
- Map<HoodieTableMetaClient, List<FileStatus>> groupedFileStatus =
groupFileStatus(fileStatuses);
- LOG.info("Found a total of " + groupedFileStatus.size() + " groups");
+ // Segregate inputPaths[] to incremental, non incremental and non hoodie
paths
+ List<String> incrementalTables =
HoodieHiveUtil.getIncrementalTableNames(Job.getInstance(job));
+ InputPathHandler inputPathHandler = new
InputPathHandler(getInputPaths(job), incrementalTables);
List<FileStatus> returns = new ArrayList<>();
- for (Map.Entry<HoodieTableMetaClient, List<FileStatus>> entry :
groupedFileStatus.entrySet()) {
- HoodieTableMetaClient metadata = entry.getKey();
- if (metadata == null) {
- // Add all the paths which are not hoodie specific
- returns.addAll(entry.getValue());
+
+ Map<String, HoodieTableMetaClient> tableMetaClientMap =
inputPathHandler.tableMetaClientMap;
+ // process incremental pulls first
+ for (String table : incrementalTables) {
+ HoodieTableMetaClient metaClient = tableMetaClientMap.get(table);
+ if (metaClient == null) {
Review comment:
No. This is for incremental tables with no input paths. Since we are taking
incremental tables list from configs, its possible (rare corner case) that a
table was set as incremental accidentally but no input paths were set for same.
----------------------------------------------------------------
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