You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "danny0405 (via GitHub)" <gi...@apache.org> on 2026/09/09 05:07:09 UTC

[PR] fix(core): use incoming record keys in native log writers [hudi]

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

   ### Describe the issue this Pull Request addresses
   
   Native log data and delete writes call `getRecordKey(recordSchema, keyFieldName)`, with the configured record-key field property passed as one field name when `populateMetaFields=false`. A composite key configuration such as `id,name` is not a single schema field and cannot be reconstructed through that fallback.
   
   The append path already receives records carrying their generated `HoodieKey`, including log-compaction records, and `prependMetaFields()` preserves that key. The existing Avro, Spark, and Flink overloads already prefer the stored key, so this change makes that contract explicit rather than claiming composite-key writes always failed previously.
   
   ### Summary and Changelog
   
   - Use `record.getRecordKey()` for native data and delete writes.
   - Remove the unused `keyFieldName` argument and caller-side key-field selection.
   - Document the incoming-key requirement and update common/Flink append-handle tests.
   - Add parameterized coverage verifying the full composite key reaches the data writer and the constructed native delete row, with metadata fields enabled and disabled.
   
   Validation: 19 tests passed across `TestHoodieNativeLogFormatWriter`, `TestHoodieNativeLogAppendHandle`, `TestFileGroupReaderBasedNativeLogAppendHandle`, and `TestFlinkNativeLogAppendHandle`. Maven reactor build, Checkstyle, and Apache RAT passed on Java 17 with Flink 2.2.
   
   ```shell
   mvn -B -Dflink2.2 -pl hudi-client/hudi-client-common,hudi-client/hudi-flink-client -am -Punit-tests -Dtest=TestHoodieNativeLogFormatWriter,TestHoodieNativeLogAppendHandle,TestFileGroupReaderBasedNativeLogAppendHandle,TestFlinkNativeLogAppendHandle -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false -DwildcardSuites=skipScalaTests test
   ```
   
   `git diff --check` and the repository PR compliance validator also passed. The full test suite was not run.
   
   ### Impact
   
   The internal `HoodieNativeLogFormatWriter.appendRecord` and `appendDeleteRecord` methods now take the record and schema only; all repository callers are updated. No storage-format, public client API, or configuration changes. Valid keyed records retain the same serialized keys; unkeyed records are outside this writer's contract. No expected material performance impact.
   
   ### Risk Level
   
   low: the change relies on the existing append-path requirement that records carry a generated key. Both data and delete paths are covered, and append-handle tests exercise routing and rollover behavior.
   
   ### Documentation Update
   
   The writer class documentation now states that incoming records must carry their generated key, including when metadata fields are disabled. No website update is needed because there is no new user-facing feature or configuration.
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] Adequate tests were added if applicable
   


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


Re: [PR] fix(core): use incoming record keys in native log writers [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19874:
URL: https://github.com/apache/hudi/pull/19874#issuecomment-5596644733

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "2b9c5fbe580d0c799b4c5641282b10ea54771f8a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=16934",
       "triggerID" : "2b9c5fbe580d0c799b4c5641282b10ea54771f8a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 2b9c5fbe580d0c799b4c5641282b10ea54771f8a Azure: [FAILURE](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=16934) 
   
   <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


Re: [PR] fix(core): use incoming record keys in native log writers [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19874:
URL: https://github.com/apache/hudi/pull/19874#issuecomment-5596201205

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "2b9c5fbe580d0c799b4c5641282b10ea54771f8a",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "2b9c5fbe580d0c799b4c5641282b10ea54771f8a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 2b9c5fbe580d0c799b4c5641282b10ea54771f8a 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


Re: [PR] fix(core): use incoming record keys in native log writers [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19874:
URL: https://github.com/apache/hudi/pull/19874#issuecomment-5598047344

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "2b9c5fbe580d0c799b4c5641282b10ea54771f8a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=16934",
       "triggerID" : "2b9c5fbe580d0c799b4c5641282b10ea54771f8a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "feb982c7e5760a304a9ff1f17c1c02c9a0c7c5c9",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=16941",
       "triggerID" : "feb982c7e5760a304a9ff1f17c1c02c9a0c7c5c9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 2b9c5fbe580d0c799b4c5641282b10ea54771f8a Azure: [FAILURE](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=16934) 
   * feb982c7e5760a304a9ff1f17c1c02c9a0c7c5c9 Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=16941) 
   
   <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


Re: [PR] fix(core): use incoming record keys in native log writers [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19874:
URL: https://github.com/apache/hudi/pull/19874#issuecomment-5597982504

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "2b9c5fbe580d0c799b4c5641282b10ea54771f8a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=16934",
       "triggerID" : "2b9c5fbe580d0c799b4c5641282b10ea54771f8a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "feb982c7e5760a304a9ff1f17c1c02c9a0c7c5c9",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "feb982c7e5760a304a9ff1f17c1c02c9a0c7c5c9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 2b9c5fbe580d0c799b4c5641282b10ea54771f8a Azure: [FAILURE](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=16934) 
   * feb982c7e5760a304a9ff1f17c1c02c9a0c7c5c9 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


Re: [PR] fix(core): use incoming record keys in native log writers [hudi]

Posted by "danny0405 (via GitHub)" <gi...@apache.org>.
danny0405 merged PR #19874:
URL: https://github.com/apache/hudi/pull/19874


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


Re: [PR] fix(core): use incoming record keys in native log writers [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19874:
URL: https://github.com/apache/hudi/pull/19874#issuecomment-5600304013

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "2b9c5fbe580d0c799b4c5641282b10ea54771f8a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=16934",
       "triggerID" : "2b9c5fbe580d0c799b4c5641282b10ea54771f8a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "feb982c7e5760a304a9ff1f17c1c02c9a0c7c5c9",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=16941",
       "triggerID" : "feb982c7e5760a304a9ff1f17c1c02c9a0c7c5c9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * feb982c7e5760a304a9ff1f17c1c02c9a0c7c5c9 Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=16941) 
   
   <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


Re: [PR] fix(core): use incoming record keys in native log writers [hudi]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #19874:
URL: https://github.com/apache/hudi/pull/19874#issuecomment-5596249494

   ## [Codecov](https://app.codecov.io/gh/apache/hudi/pull/19874?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 71.61%. Comparing base ([`eccbef9`](https://app.codecov.io/gh/apache/hudi/commit/eccbef97f33941f7c2826a3f59f59bc235a82ad5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`2b9c5fb`](https://app.codecov.io/gh/apache/hudi/commit/2b9c5fbe580d0c799b4c5641282b10ea54771f8a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #19874      +/-   ##
   ============================================
   - Coverage     71.61%   71.61%   -0.01%     
     Complexity    31083    31083              
   ============================================
     Files          2543     2543              
     Lines        142173   142167       -6     
     Branches      17283    17281       -2     
   ============================================
   - Hits         101813   101807       -6     
     Misses        32998    32998              
     Partials       7362     7362              
   ```
   
   | [Components](https://app.codecov.io/gh/apache/hudi/pull/19874/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hudi-common](https://app.codecov.io/gh/apache/hudi/pull/19874/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `81.42% <ø> (ø)` | |
   | [hudi-client](https://app.codecov.io/gh/apache/hudi/pull/19874/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `76.84% <100.00%> (-0.01%)` | :arrow_down: |
   | [hudi-flink](https://app.codecov.io/gh/apache/hudi/pull/19874/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `85.55% <ø> (ø)` | |
   | [hudi-spark-datasource](https://app.codecov.io/gh/apache/hudi/pull/19874/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `37.73% <ø> (ø)` | |
   | [hudi-utilities](https://app.codecov.io/gh/apache/hudi/pull/19874/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `74.49% <ø> (ø)` | |
   | [hudi-cli](https://app.codecov.io/gh/apache/hudi/pull/19874/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.96% <ø> (ø)` | |
   | [hudi-hadoop](https://app.codecov.io/gh/apache/hudi/pull/19874/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `67.72% <ø> (ø)` | |
   | [hudi-sync](https://app.codecov.io/gh/apache/hudi/pull/19874/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `75.92% <ø> (ø)` | |
   | [hudi-io](https://app.codecov.io/gh/apache/hudi/pull/19874/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `80.72% <ø> (ø)` | |
   | [hudi-timeline-service](https://app.codecov.io/gh/apache/hudi/pull/19874/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.86% <ø> (ø)` | |
   | [hudi-cloud](https://app.codecov.io/gh/apache/hudi/pull/19874/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `65.81% <ø> (ø)` | |
   | [hudi-kafka-connect](https://app.codecov.io/gh/apache/hudi/pull/19874/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `53.96% <ø> (ø)` | |
   
   | [Flag](https://app.codecov.io/gh/apache/hudi/pull/19874/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hadoop-mr-java-client](https://app.codecov.io/gh/apache/hudi/pull/19874/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `44.09% <100.00%> (-0.01%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/hudi/pull/19874?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...rg/apache/hudi/io/HoodieNativeLogAppendHandle.java](https://app.codecov.io/gh/apache/hudi/pull/19874?src=pr&el=tree&filepath=hudi-client%2Fhudi-client-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fhudi%2Fio%2FHoodieNativeLogAppendHandle.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aHVkaS1jbGllbnQvaHVkaS1jbGllbnQtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9odWRpL2lvL0hvb2RpZU5hdGl2ZUxvZ0FwcGVuZEhhbmRsZS5qYXZh) | `96.07% <100.00%> (-0.22%)` | :arrow_down: |
   | [...pache/hudi/io/cdc/HoodieNativeLogFormatWriter.java](https://app.codecov.io/gh/apache/hudi/pull/19874?src=pr&el=tree&filepath=hudi-client%2Fhudi-client-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fhudi%2Fio%2Fcdc%2FHoodieNativeLogFormatWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aHVkaS1jbGllbnQvaHVkaS1jbGllbnQtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9odWRpL2lvL2NkYy9Ib29kaWVOYXRpdmVMb2dGb3JtYXRXcml0ZXIuamF2YQ==) | `89.78% <100.00%> (ø)` | |
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </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


Re: [PR] fix(core): use incoming record keys in native log writers [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19874:
URL: https://github.com/apache/hudi/pull/19874#issuecomment-5596249020

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "2b9c5fbe580d0c799b4c5641282b10ea54771f8a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=16934",
       "triggerID" : "2b9c5fbe580d0c799b4c5641282b10ea54771f8a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 2b9c5fbe580d0c799b4c5641282b10ea54771f8a Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=16934) 
   
   <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