yihua opened a new pull request, #19724: URL: https://github.com/apache/hudi/pull/19724
closes #19723 ### Change Logs Backports HUDI-8795 (#12544) to `branch-0.x`, which the 0.x line never received. `hoodie.table.recordkey.fields` only shipped in 0.9.0, so a table at table version 1 does not carry it, and `validateTableConfig` rejected the write before `OneToTwoUpgradeHandler` could backfill it from the same write config. The cherry-picked commit skips that check below table version 2; from table version 2 onwards an absent record key is still a conflict. The upstream commit shipped without tests, so this PR adds them: a parameterized datasource test covering the unpartitioned and partitioned cases, one asserting the check still fires at table version 2, and a DeltaStreamer test for the path where this actually bites, the `StreamSyncService` constructor. Without the fix the DeltaStreamer test fails at `HoodieStreamer.java:707` with `RecordKey: _row_key null`, which is the reported failure. The test fixture deletes every table config a later upgrade handler backfills (the 1->2, 2->3 and 3->4 sets), not just the record key, so it matches a real table version 1 table rather than a current-version one with three keys removed. That the write still succeeds with all of them absent is what backs the claim that the record key check is the only intolerant one. ### Impact Tables at table version 1 can be written to and upgraded again on the 0.x line. No public API or format change. ### Risk level (write none, low medium or high below) low The behavior change is scoped to tables below table version 2. One thing worth flagging in review: the upstream condition is `contains(VERSION) && getInt(VERSION) > 1`, so a `hoodie.properties` carrying no version key at all now skips the record-key check entirely, including a genuine mismatch. In practice the version is always written at table creation, and this matches what `master` already runs, so this PR keeps the condition as-is rather than diverging. ### Documentation Update 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
