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/06/08 02:45:26 UTC

[GitHub] [hudi] LinMingQiang opened a new pull request, #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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

   …xception NoSuchElementException. More details are required
   
   ## *Tips*
   - *Thank you very much for contributing to Apache Hudi.*
   - *Please review https://hudi.apache.org/contribute/how-to-contribute before opening a pull request.*
   
   ## What is the purpose of the pull request
   someone encountered an `nosuchelementexception: no value present in option` error again, so I hope to bring more detailed information when reporting this exception, such as the `fileID` under which partition.Facilitate troubleshooting.
   
   ## Brief change log
   
   *(for example:)*
     - *Modify AnnotationLocation checkstyle rule in checkstyle.xml*
   
   ## Verify this pull request
   
   *(Please pick either of the following options)*
   
   This pull request is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This pull request is already covered by existing tests, such as *(please describe tests)*.
   
   (or)
   
   This change added tests and can be verified as follows:
   
   *(example:)*
   
     - *Added integration tests for end-to-end.*
     - *Added HoodieClientWriteTest to verify the change.*
     - *Manually verified the change by running a job locally.*
   
   ## Committer checklist
   
    - [ ] Has a corresponding JIRA in PR title & commit
    
    - [ ] Commit message is descriptive of the change
    
    - [ ] CI is green
   
    - [ ] Necessary doc changes done or have another open PR
          
    - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.
   


-- 
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] LinMingQiang commented on a diff in pull request #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java:
##########
@@ -116,17 +117,19 @@
   public HoodieMergeHandle(HoodieWriteConfig config, String instantTime, HoodieTable<T, I, K, O> hoodieTable,
                            Iterator<HoodieRecord<T>> recordItr, String partitionPath, String fileId,
                            TaskContextSupplier taskContextSupplier, Option<BaseKeyGenerator> keyGeneratorOpt) {
-    this(config, instantTime, hoodieTable, recordItr, partitionPath, fileId, taskContextSupplier,
-        hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId).get(), keyGeneratorOpt);
+    super(config, instantTime, partitionPath, fileId, hoodieTable, taskContextSupplier);
+    Option<HoodieBaseFile> baseFileOp = hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId);
+    if (!baseFileOp.isPresent()) {
+      throw new NoSuchElementException(String.format("FileID %s of partitionPath %s is not exist, But record loc is 'U' ", fileId, partitionPath));
+    }

Review Comment:
   ok. I'll change it right away



-- 
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 #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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


-- 
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 #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9145",
       "triggerID" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ea757ee1e9cc0b1794945199a7445099a25a4d4d",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ea757ee1e9cc0b1794945199a7445099a25a4d4d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 02b3550eb789013073e4d200ab5ec556199f6bb2 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9145) 
   * ea757ee1e9cc0b1794945199a7445099a25a4d4d 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 #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9145",
       "triggerID" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ea757ee1e9cc0b1794945199a7445099a25a4d4d",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9206",
       "triggerID" : "ea757ee1e9cc0b1794945199a7445099a25a4d4d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6894f03b9f168464e04e4c4a18149501e155a2e6",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "6894f03b9f168464e04e4c4a18149501e155a2e6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 02b3550eb789013073e4d200ab5ec556199f6bb2 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9145) 
   * ea757ee1e9cc0b1794945199a7445099a25a4d4d Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9206) 
   * 6894f03b9f168464e04e4c4a18149501e155a2e6 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 #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9145",
       "triggerID" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ea757ee1e9cc0b1794945199a7445099a25a4d4d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9206",
       "triggerID" : "ea757ee1e9cc0b1794945199a7445099a25a4d4d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6894f03b9f168464e04e4c4a18149501e155a2e6",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9210",
       "triggerID" : "6894f03b9f168464e04e4c4a18149501e155a2e6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "511c0ee785fb30fe61b59fbcc4aee3c48ee332e8",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9215",
       "triggerID" : "511c0ee785fb30fe61b59fbcc4aee3c48ee332e8",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 6894f03b9f168464e04e4c4a18149501e155a2e6 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9210) 
   * 511c0ee785fb30fe61b59fbcc4aee3c48ee332e8 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9215) 
   
   <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 #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9145",
       "triggerID" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 02b3550eb789013073e4d200ab5ec556199f6bb2 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9145) 
   
   <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 #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9145",
       "triggerID" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 02b3550eb789013073e4d200ab5ec556199f6bb2 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9145) 
   
   <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] LinMingQiang commented on a diff in pull request #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java:
##########
@@ -116,8 +117,14 @@
   public HoodieMergeHandle(HoodieWriteConfig config, String instantTime, HoodieTable<T, I, K, O> hoodieTable,
                            Iterator<HoodieRecord<T>> recordItr, String partitionPath, String fileId,
                            TaskContextSupplier taskContextSupplier, Option<BaseKeyGenerator> keyGeneratorOpt) {
-    this(config, instantTime, hoodieTable, recordItr, partitionPath, fileId, taskContextSupplier,
-        hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId).get(), keyGeneratorOpt);
+    super(config, instantTime, partitionPath, fileId, hoodieTable, taskContextSupplier);
+    Option<HoodieBaseFile> baseFileOp = hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId);
+    if (!baseFileOp.isPresent()) {
+      throw new NoSuchElementException(String.format("FileID %s of partitionPath %s is not exist, But record loc is 'U' ", fileId, partitionPath));
+    }
+    init(fileId, recordItr);

Review Comment:
   OK, I've modified it,You can check it again. thx.
   



-- 
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 #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java:
##########
@@ -139,15 +138,30 @@ public HoodieMergeHandle(HoodieWriteConfig config, String instantTime, HoodieTab
     this.keyToNewRecords = keyToNewRecords;
     this.useWriterSchemaForCompaction = true;
     this.preserveMetadata = config.isPreserveHoodieCommitMetadataForCompaction();
-    init(fileId, this.partitionPath, dataFileToBeMerged);
-    validateAndSetAndKeyGenProps(keyGeneratorOpt, config.populateMetaFields());
+    init(null, dataFileToBeMerged, keyGeneratorOpt);
   }
 
   private void validateAndSetAndKeyGenProps(Option<BaseKeyGenerator> keyGeneratorOpt, boolean populateMetaFields) {
     ValidationUtils.checkArgument(populateMetaFields == !keyGeneratorOpt.isPresent());
     this.keyGeneratorOpt = keyGeneratorOpt;
   }
 
+  private void init(Iterator<HoodieRecord<T>> recordItr, HoodieBaseFile baseFile, Option<BaseKeyGenerator> keyGeneratorOpt) {
+    if (recordItr != null) {

Review Comment:
   Can we revert this method `init` ? I don't think it makes much sense to wrap as a new method here. The different #init methods do totally different things 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] hudi-bot commented on pull request #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9145",
       "triggerID" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ea757ee1e9cc0b1794945199a7445099a25a4d4d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9206",
       "triggerID" : "ea757ee1e9cc0b1794945199a7445099a25a4d4d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6894f03b9f168464e04e4c4a18149501e155a2e6",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9210",
       "triggerID" : "6894f03b9f168464e04e4c4a18149501e155a2e6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 6894f03b9f168464e04e4c4a18149501e155a2e6 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9210) 
   
   <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 #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9145",
       "triggerID" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ea757ee1e9cc0b1794945199a7445099a25a4d4d",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9206",
       "triggerID" : "ea757ee1e9cc0b1794945199a7445099a25a4d4d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 02b3550eb789013073e4d200ab5ec556199f6bb2 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9145) 
   * ea757ee1e9cc0b1794945199a7445099a25a4d4d Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9206) 
   
   <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 #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9145",
       "triggerID" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ea757ee1e9cc0b1794945199a7445099a25a4d4d",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9206",
       "triggerID" : "ea757ee1e9cc0b1794945199a7445099a25a4d4d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6894f03b9f168464e04e4c4a18149501e155a2e6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9210",
       "triggerID" : "6894f03b9f168464e04e4c4a18149501e155a2e6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ea757ee1e9cc0b1794945199a7445099a25a4d4d Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9206) 
   * 6894f03b9f168464e04e4c4a18149501e155a2e6 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9210) 
   
   <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 #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 02b3550eb789013073e4d200ab5ec556199f6bb2 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] danny0405 commented on a diff in pull request #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java:
##########
@@ -116,17 +117,19 @@
   public HoodieMergeHandle(HoodieWriteConfig config, String instantTime, HoodieTable<T, I, K, O> hoodieTable,
                            Iterator<HoodieRecord<T>> recordItr, String partitionPath, String fileId,
                            TaskContextSupplier taskContextSupplier, Option<BaseKeyGenerator> keyGeneratorOpt) {
-    this(config, instantTime, hoodieTable, recordItr, partitionPath, fileId, taskContextSupplier,
-        hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId).get(), keyGeneratorOpt);
+    super(config, instantTime, partitionPath, fileId, hoodieTable, taskContextSupplier);
+    Option<HoodieBaseFile> baseFileOp = hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId);

Review Comment:
   If the only purpose is for logging, can we just add a tool method here for `hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId).get()`
   wrapping this code ? There is no need to refactor the constructors.



-- 
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] LinMingQiang commented on a diff in pull request #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java:
##########
@@ -116,17 +117,19 @@
   public HoodieMergeHandle(HoodieWriteConfig config, String instantTime, HoodieTable<T, I, K, O> hoodieTable,
                            Iterator<HoodieRecord<T>> recordItr, String partitionPath, String fileId,
                            TaskContextSupplier taskContextSupplier, Option<BaseKeyGenerator> keyGeneratorOpt) {
-    this(config, instantTime, hoodieTable, recordItr, partitionPath, fileId, taskContextSupplier,
-        hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId).get(), keyGeneratorOpt);
+    super(config, instantTime, partitionPath, fileId, hoodieTable, taskContextSupplier);
+    Option<HoodieBaseFile> baseFileOp = hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId);

Review Comment:
   This is a great suggestion.



-- 
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 #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9145",
       "triggerID" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ea757ee1e9cc0b1794945199a7445099a25a4d4d",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9206",
       "triggerID" : "ea757ee1e9cc0b1794945199a7445099a25a4d4d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6894f03b9f168464e04e4c4a18149501e155a2e6",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9210",
       "triggerID" : "6894f03b9f168464e04e4c4a18149501e155a2e6",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 02b3550eb789013073e4d200ab5ec556199f6bb2 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9145) 
   * ea757ee1e9cc0b1794945199a7445099a25a4d4d Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9206) 
   * 6894f03b9f168464e04e4c4a18149501e155a2e6 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9210) 
   
   <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 #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9145",
       "triggerID" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ea757ee1e9cc0b1794945199a7445099a25a4d4d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9206",
       "triggerID" : "ea757ee1e9cc0b1794945199a7445099a25a4d4d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6894f03b9f168464e04e4c4a18149501e155a2e6",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9210",
       "triggerID" : "6894f03b9f168464e04e4c4a18149501e155a2e6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "511c0ee785fb30fe61b59fbcc4aee3c48ee332e8",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "511c0ee785fb30fe61b59fbcc4aee3c48ee332e8",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 6894f03b9f168464e04e4c4a18149501e155a2e6 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9210) 
   * 511c0ee785fb30fe61b59fbcc4aee3c48ee332e8 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] danny0405 commented on a diff in pull request #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java:
##########
@@ -116,17 +117,19 @@
   public HoodieMergeHandle(HoodieWriteConfig config, String instantTime, HoodieTable<T, I, K, O> hoodieTable,
                            Iterator<HoodieRecord<T>> recordItr, String partitionPath, String fileId,
                            TaskContextSupplier taskContextSupplier, Option<BaseKeyGenerator> keyGeneratorOpt) {
-    this(config, instantTime, hoodieTable, recordItr, partitionPath, fileId, taskContextSupplier,
-        hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId).get(), keyGeneratorOpt);
+    super(config, instantTime, partitionPath, fileId, hoodieTable, taskContextSupplier);
+    Option<HoodieBaseFile> baseFileOp = hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId);
+    if (!baseFileOp.isPresent()) {
+      throw new NoSuchElementException(String.format("FileID %s of partitionPath %s is not exist, But record loc is 'U' ", fileId, partitionPath));
+    }

Review Comment:
   The loc `U` is special in Flink, we should not put it in the log of `HoodieMergeHandle`.



-- 
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 #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java:
##########
@@ -116,17 +117,19 @@
   public HoodieMergeHandle(HoodieWriteConfig config, String instantTime, HoodieTable<T, I, K, O> hoodieTable,
                            Iterator<HoodieRecord<T>> recordItr, String partitionPath, String fileId,
                            TaskContextSupplier taskContextSupplier, Option<BaseKeyGenerator> keyGeneratorOpt) {
-    this(config, instantTime, hoodieTable, recordItr, partitionPath, fileId, taskContextSupplier,
-        hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId).get(), keyGeneratorOpt);
+    super(config, instantTime, partitionPath, fileId, hoodieTable, taskContextSupplier);
+    Option<HoodieBaseFile> baseFileOp = hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId);
+    if (!baseFileOp.isPresent()) {
+      throw new NoSuchElementException(String.format("FileID %s of partitionPath %s is not exist. ", fileId, partitionPath));
+    }
+    init(recordItr, baseFileOp.get(), keyGeneratorOpt);
   }

Review Comment:
   `FileID %s of partitionPath %s is not exist.` -> `FileID %s of partition path %s does not exist.`



-- 
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 #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9145",
       "triggerID" : "02b3550eb789013073e4d200ab5ec556199f6bb2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ea757ee1e9cc0b1794945199a7445099a25a4d4d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9206",
       "triggerID" : "ea757ee1e9cc0b1794945199a7445099a25a4d4d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6894f03b9f168464e04e4c4a18149501e155a2e6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9210",
       "triggerID" : "6894f03b9f168464e04e4c4a18149501e155a2e6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "511c0ee785fb30fe61b59fbcc4aee3c48ee332e8",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9215",
       "triggerID" : "511c0ee785fb30fe61b59fbcc4aee3c48ee332e8",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 511c0ee785fb30fe61b59fbcc4aee3c48ee332e8 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=9215) 
   
   <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 #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java:
##########
@@ -116,8 +117,14 @@
   public HoodieMergeHandle(HoodieWriteConfig config, String instantTime, HoodieTable<T, I, K, O> hoodieTable,
                            Iterator<HoodieRecord<T>> recordItr, String partitionPath, String fileId,
                            TaskContextSupplier taskContextSupplier, Option<BaseKeyGenerator> keyGeneratorOpt) {
-    this(config, instantTime, hoodieTable, recordItr, partitionPath, fileId, taskContextSupplier,
-        hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId).get(), keyGeneratorOpt);
+    super(config, instantTime, partitionPath, fileId, hoodieTable, taskContextSupplier);
+    Option<HoodieBaseFile> baseFileOp = hoodieTable.getBaseFileOnlyView().getLatestBaseFile(partitionPath, fileId);
+    if (!baseFileOp.isPresent()) {
+      throw new NoSuchElementException(String.format("FileID %s of partitionPath %s is not exist, But record loc is 'U' ", fileId, partitionPath));
+    }
+    init(fileId, recordItr);

Review Comment:
   can we move line 125 to 127 to a private method and call from within both the constructors. 



-- 
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 #5788: [HUDI-4207] HoodieFlinkWriteClient.getOrCreateWriteHandle throws an e…

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java:
##########
@@ -139,15 +138,30 @@ public HoodieMergeHandle(HoodieWriteConfig config, String instantTime, HoodieTab
     this.keyToNewRecords = keyToNewRecords;
     this.useWriterSchemaForCompaction = true;
     this.preserveMetadata = config.isPreserveHoodieCommitMetadataForCompaction();
-    init(fileId, this.partitionPath, dataFileToBeMerged);
-    validateAndSetAndKeyGenProps(keyGeneratorOpt, config.populateMetaFields());
+    init(null, dataFileToBeMerged, keyGeneratorOpt);
   }
 
   private void validateAndSetAndKeyGenProps(Option<BaseKeyGenerator> keyGeneratorOpt, boolean populateMetaFields) {
     ValidationUtils.checkArgument(populateMetaFields == !keyGeneratorOpt.isPresent());
     this.keyGeneratorOpt = keyGeneratorOpt;
   }
 
+  private void init(Iterator<HoodieRecord<T>> recordItr, HoodieBaseFile baseFile, Option<BaseKeyGenerator> keyGeneratorOpt) {
+    if (recordItr != null) {

Review Comment:
   Can we revert this method `init` ? I don't think it makes much sense to wrap as a new method here. The two #init methods do totally different things 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