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/09/08 03:12:22 UTC

[GitHub] [hudi] TJX2014 opened a new pull request, #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   ### Change Logs
   Make HoodieSimpleBucketIndex also load bucket index from log file
   
   ### Impact
   Spark will read bucket index correctly where the log file is written by flink to mor table. 
   
   **Risk level: none | low | medium | high**
   none
   
   ### 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] danny0405 commented on a diff in pull request #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/bucket/HoodieSimpleBucketIndex.java:
##########
@@ -52,10 +54,20 @@ private Map<Integer, HoodieRecordLocation> loadPartitionBucketIdFileIdMapping(
     Map<Integer, HoodieRecordLocation> bucketIdToFileIdMapping = new HashMap<>();
     hoodieTable.getMetaClient().reloadActiveTimeline();
     HoodieIndexUtils
-        .getLatestBaseFilesForPartition(partition, hoodieTable)
-        .forEach(file -> {
-          String fileId = file.getFileId();
-          String commitTime = file.getCommitTime();
+        .getLatestFileSlicesForPartition(partition, hoodieTable)
+        .forEach(fileSlice -> {
+          String fileId;
+          String commitTime;

Review Comment:
   Every file slice has basic props like fileGroupId and baseCommitTime, there is no need to look into the details if you want  only these two.



-- 
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] danny0405 commented on a diff in pull request #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/HoodieIndexUtils.java:
##########
@@ -72,6 +73,26 @@ public static List<HoodieBaseFile> getLatestBaseFilesForPartition(
     return Collections.emptyList();
   }
 
+  /**
+   * Fetches Pair of partition path and {@link FileSlice}s for interested partitions.
+   *
+   * @param partition   Partition of interest
+   * @param hoodieTable Instance of {@link HoodieTable} of interest
+   * @return the list of {@link FileSlice}
+   */
+  public static List<FileSlice> getLatestFileSlicesForPartition(
+          final String partition,
+          final HoodieTable hoodieTable) {
+    Option<HoodieInstant> latestCommitTime = hoodieTable.getMetaClient().getCommitsTimeline()
+            .filterCompletedInstants().lastInstant();
+    if (latestCommitTime.isPresent()) {
+      return hoodieTable.getHoodieView()
+              .getLatestFileSlicesBeforeOrOn(partition, latestCommitTime.get().getTimestamp(), true)
+              .collect(toList());

Review Comment:
   Seems reasonable fix, can we add a test case for it.



-- 
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 #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11239",
       "triggerID" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11378",
       "triggerID" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c6fe58f992656d26e60f24e2b5791613f55e5bd3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11382",
       "triggerID" : "c6fe58f992656d26e60f24e2b5791613f55e5bd3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8746849f96d764a6203009df3f856ef564ff0931",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11420",
       "triggerID" : "8746849f96d764a6203009df3f856ef564ff0931",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4af54a811fd9e7695ba1e6139a8d0f9b915549d0",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4af54a811fd9e7695ba1e6139a8d0f9b915549d0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8746849f96d764a6203009df3f856ef564ff0931 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11420) 
   * 4af54a811fd9e7695ba1e6139a8d0f9b915549d0 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 #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11239",
       "triggerID" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11378",
       "triggerID" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c6fe58f992656d26e60f24e2b5791613f55e5bd3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11382",
       "triggerID" : "c6fe58f992656d26e60f24e2b5791613f55e5bd3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8746849f96d764a6203009df3f856ef564ff0931",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11420",
       "triggerID" : "8746849f96d764a6203009df3f856ef564ff0931",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4af54a811fd9e7695ba1e6139a8d0f9b915549d0",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11481",
       "triggerID" : "4af54a811fd9e7695ba1e6139a8d0f9b915549d0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4af54a811fd9e7695ba1e6139a8d0f9b915549d0 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11481) 
   
   <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 #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 85a8f5166c17ec5ce9fa00e2c38846f440582acf 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 #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11239",
       "triggerID" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 85a8f5166c17ec5ce9fa00e2c38846f440582acf Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11239) 
   * bdf3e337bd0b82ba1e59887f10cffdbe50fbde99 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] TJX2014 commented on a diff in pull request #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/bucket/HoodieSimpleBucketIndex.java:
##########
@@ -52,10 +54,20 @@ private Map<Integer, HoodieRecordLocation> loadPartitionBucketIdFileIdMapping(
     Map<Integer, HoodieRecordLocation> bucketIdToFileIdMapping = new HashMap<>();
     hoodieTable.getMetaClient().reloadActiveTimeline();
     HoodieIndexUtils
-        .getLatestBaseFilesForPartition(partition, hoodieTable)
-        .forEach(file -> {
-          String fileId = file.getFileId();
-          String commitTime = file.getCommitTime();
+        .getLatestFileSlicesForPartition(partition, hoodieTable)
+        .forEach(fileSlice -> {
+          String fileId;
+          String commitTime;

Review Comment:
   Of course, the test code could cover this.



-- 
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] TJX2014 commented on pull request #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   Hi, @danny0405 , this is another patch for https://github.com/apache/hudi/pull/6595


-- 
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 #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11239",
       "triggerID" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 85a8f5166c17ec5ce9fa00e2c38846f440582acf Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11239) 
   
   <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 #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11239",
       "triggerID" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11378",
       "triggerID" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c6fe58f992656d26e60f24e2b5791613f55e5bd3",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11382",
       "triggerID" : "c6fe58f992656d26e60f24e2b5791613f55e5bd3",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bdf3e337bd0b82ba1e59887f10cffdbe50fbde99 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11378) 
   * c6fe58f992656d26e60f24e2b5791613f55e5bd3 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11382) 
   
   <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] danny0405 commented on a diff in pull request #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/bucket/HoodieSimpleBucketIndex.java:
##########
@@ -52,10 +54,20 @@ private Map<Integer, HoodieRecordLocation> loadPartitionBucketIdFileIdMapping(
     Map<Integer, HoodieRecordLocation> bucketIdToFileIdMapping = new HashMap<>();
     hoodieTable.getMetaClient().reloadActiveTimeline();
     HoodieIndexUtils
-        .getLatestBaseFilesForPartition(partition, hoodieTable)
-        .forEach(file -> {
-          String fileId = file.getFileId();
-          String commitTime = file.getCommitTime();
+        .getLatestFileSlicesForPartition(partition, hoodieTable)
+        .forEach(fileSlice -> {
+          String fileId;
+          String commitTime;

Review Comment:
   Does
   ```java
       fileSlice.getFileId();
       fileSlice.getBaseInstantTime();
   ```
   
   work here ?



-- 
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] TJX2014 commented on a diff in pull request #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/HoodieIndexUtils.java:
##########
@@ -72,6 +73,26 @@ public static List<HoodieBaseFile> getLatestBaseFilesForPartition(
     return Collections.emptyList();
   }
 
+  /**
+   * Fetches Pair of partition path and {@link FileSlice}s for interested partitions.
+   *
+   * @param partition   Partition of interest
+   * @param hoodieTable Instance of {@link HoodieTable} of interest
+   * @return the list of {@link FileSlice}
+   */
+  public static List<FileSlice> getLatestFileSlicesForPartition(
+          final String partition,
+          final HoodieTable hoodieTable) {
+    Option<HoodieInstant> latestCommitTime = hoodieTable.getMetaClient().getCommitsTimeline()
+            .filterCompletedInstants().lastInstant();
+    if (latestCommitTime.isPresent()) {
+      return hoodieTable.getHoodieView()
+              .getLatestFileSlicesBeforeOrOn(partition, latestCommitTime.get().getTimestamp(), true)
+              .collect(toList());

Review Comment:
   Ok, I will add a test for this pr.



-- 
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 #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11239",
       "triggerID" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11378",
       "triggerID" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c6fe58f992656d26e60f24e2b5791613f55e5bd3",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11382",
       "triggerID" : "c6fe58f992656d26e60f24e2b5791613f55e5bd3",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c6fe58f992656d26e60f24e2b5791613f55e5bd3 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11382) 
   
   <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] TJX2014 commented on pull request #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   @minihippo hi, please help me check this, I think this patch could fix the HoodieSimpleBucketIndex firstly.


-- 
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] TJX2014 commented on a diff in pull request #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/HoodieIndexUtils.java:
##########
@@ -72,6 +73,26 @@ public static List<HoodieBaseFile> getLatestBaseFilesForPartition(
     return Collections.emptyList();
   }
 
+  /**
+   * Fetches Pair of partition path and {@link FileSlice}s for interested partitions.
+   *
+   * @param partition   Partition of interest
+   * @param hoodieTable Instance of {@link HoodieTable} of interest
+   * @return the list of {@link FileSlice}
+   */
+  public static List<FileSlice> getLatestFileSlicesForPartition(
+          final String partition,
+          final HoodieTable hoodieTable) {
+    Option<HoodieInstant> latestCommitTime = hoodieTable.getMetaClient().getCommitsTimeline()
+            .filterCompletedInstants().lastInstant();
+    if (latestCommitTime.isPresent()) {
+      return hoodieTable.getHoodieView()
+              .getLatestFileSlicesBeforeOrOn(partition, latestCommitTime.get().getTimestamp(), true)
+              .collect(toList());

Review Comment:
   Hi @danny0405 , I have added a test for log type, please review again.



-- 
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 #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11239",
       "triggerID" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11378",
       "triggerID" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c6fe58f992656d26e60f24e2b5791613f55e5bd3",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11382",
       "triggerID" : "c6fe58f992656d26e60f24e2b5791613f55e5bd3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8746849f96d764a6203009df3f856ef564ff0931",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "8746849f96d764a6203009df3f856ef564ff0931",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c6fe58f992656d26e60f24e2b5791613f55e5bd3 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11382) 
   * 8746849f96d764a6203009df3f856ef564ff0931 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 #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11239",
       "triggerID" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11378",
       "triggerID" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c6fe58f992656d26e60f24e2b5791613f55e5bd3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11382",
       "triggerID" : "c6fe58f992656d26e60f24e2b5791613f55e5bd3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8746849f96d764a6203009df3f856ef564ff0931",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11420",
       "triggerID" : "8746849f96d764a6203009df3f856ef564ff0931",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4af54a811fd9e7695ba1e6139a8d0f9b915549d0",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11481",
       "triggerID" : "4af54a811fd9e7695ba1e6139a8d0f9b915549d0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8746849f96d764a6203009df3f856ef564ff0931 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11420) 
   * 4af54a811fd9e7695ba1e6139a8d0f9b915549d0 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11481) 
   
   <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 #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11239",
       "triggerID" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11378",
       "triggerID" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c6fe58f992656d26e60f24e2b5791613f55e5bd3",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11382",
       "triggerID" : "c6fe58f992656d26e60f24e2b5791613f55e5bd3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8746849f96d764a6203009df3f856ef564ff0931",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11420",
       "triggerID" : "8746849f96d764a6203009df3f856ef564ff0931",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c6fe58f992656d26e60f24e2b5791613f55e5bd3 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11382) 
   * 8746849f96d764a6203009df3f856ef564ff0931 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11420) 
   
   <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] minihippo commented on pull request #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   LGTM


-- 
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] TJX2014 commented on a diff in pull request #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/bucket/HoodieSimpleBucketIndex.java:
##########
@@ -52,10 +51,11 @@ private Map<Integer, HoodieRecordLocation> loadPartitionBucketIdFileIdMapping(
     Map<Integer, HoodieRecordLocation> bucketIdToFileIdMapping = new HashMap<>();
     hoodieTable.getMetaClient().reloadActiveTimeline();
     HoodieIndexUtils
-        .getLatestBaseFilesForPartition(partition, hoodieTable)
-        .forEach(file -> {
-          String fileId = file.getFileId();
-          String commitTime = file.getCommitTime();
+        .getLatestFileSlicesForPartition(partition, hoodieTable)
+        .forEach(fileSlice -> {
+          String fileId = fileSlice.getFileId();
+          String commitTime = fileSlice.getBaseInstantTime();

Review Comment:
   Hi @danny0405 Thanks for your suggestion, I have corrected it, please review again : )



-- 
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] TJX2014 commented on a diff in pull request #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/bucket/HoodieSimpleBucketIndex.java:
##########
@@ -52,10 +54,20 @@ private Map<Integer, HoodieRecordLocation> loadPartitionBucketIdFileIdMapping(
     Map<Integer, HoodieRecordLocation> bucketIdToFileIdMapping = new HashMap<>();
     hoodieTable.getMetaClient().reloadActiveTimeline();
     HoodieIndexUtils
-        .getLatestBaseFilesForPartition(partition, hoodieTable)
-        .forEach(file -> {
-          String fileId = file.getFileId();
-          String commitTime = file.getCommitTime();
+        .getLatestFileSlicesForPartition(partition, hoodieTable)
+        .forEach(fileSlice -> {
+          String fileId;
+          String commitTime;

Review Comment:
   @danny0405 To cow table not have log file, seems we need to consider base file. But to mor table when the log file in not compacted to base file, which we need to consider log file.



-- 
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] TJX2014 commented on a diff in pull request #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/HoodieIndexUtils.java:
##########
@@ -72,6 +73,26 @@ public static List<HoodieBaseFile> getLatestBaseFilesForPartition(
     return Collections.emptyList();
   }
 
+  /**
+   * Fetches Pair of partition path and {@link FileSlice}s for interested partitions.
+   *
+   * @param partition   Partition of interest
+   * @param hoodieTable Instance of {@link HoodieTable} of interest
+   * @return the list of {@link FileSlice}
+   */
+  public static List<FileSlice> getLatestFileSlicesForPartition(
+          final String partition,
+          final HoodieTable hoodieTable) {
+    Option<HoodieInstant> latestCommitTime = hoodieTable.getMetaClient().getCommitsTimeline()
+            .filterCompletedInstants().lastInstant();
+    if (latestCommitTime.isPresent()) {
+      return hoodieTable.getHoodieView()
+              .getLatestFileSlicesBeforeOrOn(partition, latestCommitTime.get().getTimestamp(), true)
+              .collect(toList());

Review Comment:
   Seems a little hard, because the mor log file is written in hudi-flink module, but only hudi-spark use HoodieIndexUtils.



-- 
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] TJX2014 commented on pull request #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   Hi @danny0405 ci succeed.


-- 
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 #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11239",
       "triggerID" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 85a8f5166c17ec5ce9fa00e2c38846f440582acf Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11239) 
   
   <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] minihippo commented on a diff in pull request #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/HoodieIndexUtils.java:
##########
@@ -72,6 +73,26 @@ public static List<HoodieBaseFile> getLatestBaseFilesForPartition(
     return Collections.emptyList();
   }
 
+  /**
+   * Fetches Pair of partition path and {@link FileSlice}s for interested partitions.
+   *
+   * @param partition   Partition of interest
+   * @param hoodieTable Instance of {@link HoodieTable} of interest
+   * @return the list of {@link FileSlice}
+   */
+  public static List<FileSlice> getLatestFileSlicesForPartition(
+          final String partition,
+          final HoodieTable hoodieTable) {
+    Option<HoodieInstant> latestCommitTime = hoodieTable.getMetaClient().getCommitsTimeline()
+            .filterCompletedInstants().lastInstant();
+    if (latestCommitTime.isPresent()) {
+      return hoodieTable.getHoodieView()
+              .getLatestFileSlicesBeforeOrOn(partition, latestCommitTime.get().getTimestamp(), true)
+              .collect(toList());

Review Comment:
   +1



-- 
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 #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11239",
       "triggerID" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11378",
       "triggerID" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 85a8f5166c17ec5ce9fa00e2c38846f440582acf Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11239) 
   * bdf3e337bd0b82ba1e59887f10cffdbe50fbde99 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11378) 
   
   <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] TJX2014 commented on a diff in pull request #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/bucket/HoodieSimpleBucketIndex.java:
##########
@@ -52,10 +54,20 @@ private Map<Integer, HoodieRecordLocation> loadPartitionBucketIdFileIdMapping(
     Map<Integer, HoodieRecordLocation> bucketIdToFileIdMapping = new HashMap<>();
     hoodieTable.getMetaClient().reloadActiveTimeline();
     HoodieIndexUtils
-        .getLatestBaseFilesForPartition(partition, hoodieTable)
-        .forEach(file -> {
-          String fileId = file.getFileId();
-          String commitTime = file.getCommitTime();
+        .getLatestFileSlicesForPartition(partition, hoodieTable)
+        .forEach(fileSlice -> {
+          String fileId;
+          String commitTime;

Review Comment:
   Great ~ Hi @danny0405 , please see again, I have corrected.



-- 
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] danny0405 merged pull request #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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


-- 
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] danny0405 commented on a diff in pull request #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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


##########
hudi-client/hudi-client-common/src/test/java/org/apache/hudi/testutils/HoodieWriteableTestTable.java:
##########
@@ -152,27 +151,21 @@ public Path withInserts(String partition, String fileId, List<HoodieRecord> reco
     return baseFilePath;
   }
 
-  public Map<String, List<HoodieLogFile>> withLogAppends(List<HoodieRecord> records) throws Exception {
+  public Map<String, List<HoodieLogFile>> withAppends(String partition, String fileId, List<HoodieRecord> records) throws Exception {
     Map<String, List<HoodieLogFile>> partitionToLogfilesMap = new HashMap<>();
-    for (List<HoodieRecord> groupedRecords : records.stream()

Review Comment:
   Is there any special reason we rename the method from `withLogAppends` to `withAppends` ?



##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/bucket/HoodieSimpleBucketIndex.java:
##########
@@ -52,10 +54,20 @@ private Map<Integer, HoodieRecordLocation> loadPartitionBucketIdFileIdMapping(
     Map<Integer, HoodieRecordLocation> bucketIdToFileIdMapping = new HashMap<>();
     hoodieTable.getMetaClient().reloadActiveTimeline();
     HoodieIndexUtils
-        .getLatestBaseFilesForPartition(partition, hoodieTable)
-        .forEach(file -> {
-          String fileId = file.getFileId();
-          String commitTime = file.getCommitTime();
+        .getLatestFileSlicesForPartition(partition, hoodieTable)
+        .forEach(fileSlice -> {
+          String fileId;
+          String commitTime;

Review Comment:
   I mean there is no need to decide whether the base file exists, just use the methods above should work well.



-- 
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] TJX2014 commented on a diff in pull request #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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


##########
hudi-client/hudi-client-common/src/test/java/org/apache/hudi/testutils/HoodieWriteableTestTable.java:
##########
@@ -152,27 +151,21 @@ public Path withInserts(String partition, String fileId, List<HoodieRecord> reco
     return baseFilePath;
   }
 
-  public Map<String, List<HoodieLogFile>> withLogAppends(List<HoodieRecord> records) throws Exception {
+  public Map<String, List<HoodieLogFile>> withAppends(String partition, String fileId, List<HoodieRecord> records) throws Exception {
     Map<String, List<HoodieLogFile>> partitionToLogfilesMap = new HashMap<>();
-    for (List<HoodieRecord> groupedRecords : records.stream()

Review Comment:
   Seems `withAppends ` more consistent with former `withInserts`, I will recover to `withLogAppends ` follow your advice.



-- 
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 #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11239",
       "triggerID" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11378",
       "triggerID" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c6fe58f992656d26e60f24e2b5791613f55e5bd3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11382",
       "triggerID" : "c6fe58f992656d26e60f24e2b5791613f55e5bd3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8746849f96d764a6203009df3f856ef564ff0931",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11420",
       "triggerID" : "8746849f96d764a6203009df3f856ef564ff0931",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8746849f96d764a6203009df3f856ef564ff0931 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11420) 
   
   <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 #6630: [HUDI-4808] Fix HoodieSimpleBucketIndex not consider bucket num in lo…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11239",
       "triggerID" : "85a8f5166c17ec5ce9fa00e2c38846f440582acf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11378",
       "triggerID" : "bdf3e337bd0b82ba1e59887f10cffdbe50fbde99",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c6fe58f992656d26e60f24e2b5791613f55e5bd3",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c6fe58f992656d26e60f24e2b5791613f55e5bd3",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * bdf3e337bd0b82ba1e59887f10cffdbe50fbde99 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=11378) 
   * c6fe58f992656d26e60f24e2b5791613f55e5bd3 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