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/12/17 07:58:34 UTC

[GitHub] [hudi] codope opened a new pull request, #7493: Avoid file index and use fs view cache in COW input format

codope opened a new pull request, #7493:
URL: https://github.com/apache/hudi/pull/7493

   ### Change Logs
   
   _Describe context and summary for this change. Highlight if any code was copied._
   
   ### Impact
   
   _Describe any public API or user-facing feature change or any performance impact._
   
   ### Risk level (write none, low medium or high below)
   
   _If medium or high, explain what verification was done to mitigate the risks._
   
   ### Documentation Update
   
   _Describe any necessary documentation update if there is any new feature, config, or user-facing change_
   
   - _The config description must be updated if new configs are added or the default value of the configs are changed_
   - _Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
     ticket number here and follow the [instruction](https://hudi.apache.org/contribute/developer-setup#website) to make
     changes to the website._
   
   ### Contributor's checklist
   
   - [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [ ] Change Logs and Impact were stated clearly
   - [ ] Adequate tests were added if applicable
   - [ ] CI passed
   


-- 
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


[GitHub] [hudi] nsivabalan commented on pull request #7493: [HUDI-5409] Avoid file index and use fs view cache in COW input format

Posted by GitBox <gi...@apache.org>.
nsivabalan commented on PR #7493:
URL: https://github.com/apache/hudi/pull/7493#issuecomment-1356346520

   There is one flaky test (col stats). CI is green otherwise. 
   <img width="1174" alt="Screen Shot 2022-12-17 at 9 30 14 AM" src="https://user-images.githubusercontent.com/513218/208254075-9df3cad7-6abc-4ac6-82ce-37465149d717.png">
   


-- 
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


[GitHub] [hudi] hudi-bot commented on pull request #7493: [HUDI-5409] Avoid file index and use fs view cache in COW input format

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #7493:
URL: https://github.com/apache/hudi/pull/7493#issuecomment-1356296290

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "081d6925c0bd2ee8a122a6c023b2f28fdf0532d0",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13826",
       "triggerID" : "081d6925c0bd2ee8a122a6c023b2f28fdf0532d0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c697f08b6ebd6119187039a19c114dc61f39038",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0c697f08b6ebd6119187039a19c114dc61f39038",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 081d6925c0bd2ee8a122a6c023b2f28fdf0532d0 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13826) 
   * 0c697f08b6ebd6119187039a19c114dc61f39038 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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


[GitHub] [hudi] hudi-bot commented on pull request #7493: [HUDI-5409] Avoid file index and use fs view cache in COW input format

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #7493:
URL: https://github.com/apache/hudi/pull/7493#issuecomment-1356299825

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "081d6925c0bd2ee8a122a6c023b2f28fdf0532d0",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13826",
       "triggerID" : "081d6925c0bd2ee8a122a6c023b2f28fdf0532d0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c697f08b6ebd6119187039a19c114dc61f39038",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13829",
       "triggerID" : "0c697f08b6ebd6119187039a19c114dc61f39038",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 081d6925c0bd2ee8a122a6c023b2f28fdf0532d0 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13826) 
   * 0c697f08b6ebd6119187039a19c114dc61f39038 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13829) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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


[GitHub] [hudi] nsivabalan commented on a diff in pull request #7493: Avoid file index and use fs view cache in COW input format

Posted by GitBox <gi...@apache.org>.
nsivabalan commented on code in PR #7493:
URL: https://github.com/apache/hudi/pull/7493#discussion_r1051358907


##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/HoodieCopyOnWriteTableInputFormat.java:
##########
@@ -236,28 +249,53 @@ private List<FileStatus> listStatusForSnapshotMode(JobConf job,
       boolean shouldIncludePendingCommits =
           HoodieHiveUtils.shouldIncludePendingCommits(job, tableMetaClient.getTableConfig().getTableName());
 
-      HiveHoodieTableFileIndex fileIndex =
-          new HiveHoodieTableFileIndex(
-              engineContext,
-              tableMetaClient,
-              props,
-              HoodieTableQueryType.SNAPSHOT,
-              partitionPaths,
-              queryCommitInstant,
-              shouldIncludePendingCommits);
-
-      Map<String, List<FileSlice>> partitionedFileSlices = fileIndex.listFileSlices();
-
-      Option<HoodieVirtualKeyInfo> virtualKeyInfoOpt = getHoodieVirtualKeyInfo(tableMetaClient);
-
-      targetFiles.addAll(
-          partitionedFileSlices.values()
-              .stream()
-              .flatMap(Collection::stream)
-              .filter(fileSlice -> checkIfValidFileSlice(fileSlice))
-              .map(fileSlice -> createFileStatusUnchecked(fileSlice, fileIndex, virtualKeyInfoOpt))
-              .collect(Collectors.toList())
-      );
+      if (conf.getBoolean(ENABLE.key(), DEFAULT_METADATA_ENABLE_FOR_READERS) && HoodieTableMetadataUtil.isFilesPartitionAvailable(tableMetaClient)) {
+        HiveHoodieTableFileIndex fileIndex =
+            new HiveHoodieTableFileIndex(
+                engineContext,
+                tableMetaClient,
+                props,
+                HoodieTableQueryType.SNAPSHOT,
+                partitionPaths,
+                queryCommitInstant,
+                shouldIncludePendingCommits);
+
+        Map<String, List<FileSlice>> partitionedFileSlices = fileIndex.listFileSlices();
+
+        Option<HoodieVirtualKeyInfo> virtualKeyInfoOpt = getHoodieVirtualKeyInfo(tableMetaClient);
+
+        targetFiles.addAll(
+            partitionedFileSlices.values()
+                .stream()
+                .flatMap(Collection::stream)
+                .filter(fileSlice -> checkIfValidFileSlice(fileSlice))
+                .map(fileSlice -> createFileStatusUnchecked(fileSlice, fileIndex, virtualKeyInfoOpt))
+                .collect(Collectors.toList())
+        );
+      } else {
+        HoodieTimeline timeline = tableMetaClient.getActiveTimeline();
+
+        try {
+          HoodieTableFileSystemView fsView = fsViewCache.computeIfAbsent(tableMetaClient, hoodietableMetaClient ->
+              FileSystemViewManager.createInMemoryFileSystemViewWithTimeline(engineContext, hoodietableMetaClient, buildMetadataConfig(job), timeline));
+
+          List<HoodieBaseFile> filteredBaseFiles = new ArrayList<>();
+
+          for (Path p : entry.getValue()) {
+            String relativePartitionPath = FSUtils.getRelativePartitionPath(new Path(tableMetaClient.getBasePath()), p);
+            List<HoodieBaseFile> matched = fsView.getLatestBaseFiles(relativePartitionPath).collect(Collectors.toList());

Review Comment:
   minor. variable naming.
   ```
   List<HoodieBaseFile> latestBaseFiles
   ```



-- 
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


[GitHub] [hudi] nsivabalan merged pull request #7493: [HUDI-5409] Avoid file index and use fs view cache in COW input format

Posted by GitBox <gi...@apache.org>.
nsivabalan merged PR #7493:
URL: https://github.com/apache/hudi/pull/7493


-- 
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


[GitHub] [hudi] hudi-bot commented on pull request #7493: [HUDI-5409] Avoid file index and use fs view cache in COW input format

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #7493:
URL: https://github.com/apache/hudi/pull/7493#issuecomment-1356229669

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "081d6925c0bd2ee8a122a6c023b2f28fdf0532d0",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13826",
       "triggerID" : "081d6925c0bd2ee8a122a6c023b2f28fdf0532d0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 081d6925c0bd2ee8a122a6c023b2f28fdf0532d0 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13826) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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


[GitHub] [hudi] yihua commented on a diff in pull request #7493: Avoid file index and use fs view cache in COW input format

Posted by GitBox <gi...@apache.org>.
yihua commented on code in PR #7493:
URL: https://github.com/apache/hudi/pull/7493#discussion_r1051360692


##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/HoodieCopyOnWriteTableInputFormat.java:
##########
@@ -236,28 +249,53 @@ private List<FileStatus> listStatusForSnapshotMode(JobConf job,
       boolean shouldIncludePendingCommits =
           HoodieHiveUtils.shouldIncludePendingCommits(job, tableMetaClient.getTableConfig().getTableName());
 
-      HiveHoodieTableFileIndex fileIndex =
-          new HiveHoodieTableFileIndex(
-              engineContext,
-              tableMetaClient,
-              props,
-              HoodieTableQueryType.SNAPSHOT,
-              partitionPaths,
-              queryCommitInstant,
-              shouldIncludePendingCommits);
-
-      Map<String, List<FileSlice>> partitionedFileSlices = fileIndex.listFileSlices();
-
-      Option<HoodieVirtualKeyInfo> virtualKeyInfoOpt = getHoodieVirtualKeyInfo(tableMetaClient);
-
-      targetFiles.addAll(
-          partitionedFileSlices.values()
-              .stream()
-              .flatMap(Collection::stream)
-              .filter(fileSlice -> checkIfValidFileSlice(fileSlice))
-              .map(fileSlice -> createFileStatusUnchecked(fileSlice, fileIndex, virtualKeyInfoOpt))
-              .collect(Collectors.toList())
-      );
+      if (conf.getBoolean(ENABLE.key(), DEFAULT_METADATA_ENABLE_FOR_READERS) && HoodieTableMetadataUtil.isFilesPartitionAvailable(tableMetaClient)) {
+        HiveHoodieTableFileIndex fileIndex =
+            new HiveHoodieTableFileIndex(
+                engineContext,
+                tableMetaClient,
+                props,
+                HoodieTableQueryType.SNAPSHOT,
+                partitionPaths,
+                queryCommitInstant,
+                shouldIncludePendingCommits);
+
+        Map<String, List<FileSlice>> partitionedFileSlices = fileIndex.listFileSlices();
+
+        Option<HoodieVirtualKeyInfo> virtualKeyInfoOpt = getHoodieVirtualKeyInfo(tableMetaClient);
+
+        targetFiles.addAll(
+            partitionedFileSlices.values()
+                .stream()
+                .flatMap(Collection::stream)
+                .filter(fileSlice -> checkIfValidFileSlice(fileSlice))
+                .map(fileSlice -> createFileStatusUnchecked(fileSlice, fileIndex, virtualKeyInfoOpt))
+                .collect(Collectors.toList())
+        );
+      } else {
+        HoodieTimeline timeline = tableMetaClient.getActiveTimeline();
+
+        try {
+          HoodieTableFileSystemView fsView = fsViewCache.computeIfAbsent(tableMetaClient, hoodietableMetaClient ->

Review Comment:
   +1 Essentially, this is the old logic from 0.8.0 release, which the fallback when metadata table is not used: https://github.com/apache/hudi/blob/release-0.8.0/hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/utils/HoodieInputFormatUtils.java#L443



-- 
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


[GitHub] [hudi] hudi-bot commented on pull request #7493: Avoid file index and use fs view cache in COW input format

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #7493:
URL: https://github.com/apache/hudi/pull/7493#issuecomment-1356114195

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "081d6925c0bd2ee8a122a6c023b2f28fdf0532d0",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13826",
       "triggerID" : "081d6925c0bd2ee8a122a6c023b2f28fdf0532d0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 081d6925c0bd2ee8a122a6c023b2f28fdf0532d0 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13826) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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


[GitHub] [hudi] hudi-bot commented on pull request #7493: Avoid file index and use fs view cache in COW input format

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #7493:
URL: https://github.com/apache/hudi/pull/7493#issuecomment-1356112261

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "081d6925c0bd2ee8a122a6c023b2f28fdf0532d0",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "081d6925c0bd2ee8a122a6c023b2f28fdf0532d0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 081d6925c0bd2ee8a122a6c023b2f28fdf0532d0 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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