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

   ### Describe the issue this Pull Request addresses
   
   When a log-only record sorts before the current base record, 
`SortedKeyBasedFileGroupRecordBuffer` passes the base record's key to 
`UpdateProcessor` together with the log record. For example, inserting `a` 
before base record `b` invokes the insert callback with key `b` and record `a`. 
With delete emission enabled, an empty delete for `a` can similarly produce a 
delete row for `b`.
   
   ### Summary and Changelog
   
   - Pass `nextLogRecordKey` to the update processor when consuming a log-only 
record before the current base record.
   - Add regression coverage for multiple preceding inserts, a delete between 
base records, and the log-only tail, with delete emission both enabled and 
disabled. Verify output records and callback keys.
   
   ### Impact
   
   Corrects record identity for callers that consume update callbacks or 
request synthesized delete rows when merging sorted base and log records. No 
public API, configuration, or file-format changes.
   
   ### Risk Level
   
   Low. The production change replaces one argument and preserves merge 
ordering. Both new parameterized cases fail before the fix; the full 
`TestSortedKeyBasedFileGroupRecordBuffer` class passes afterward: 6 tests, 0 
failures, 0 errors, 0 skipped. Checkstyle and license checks pass.
   
   Validation:
   
   ```bash
   mvn -o -pl hudi-common -am \
     -Dtest=TestSortedKeyBasedFileGroupRecordBuffer \
     -Dsurefire.failIfNoSpecifiedTests=false \
     -DskipITs -DskipSparkTests -DskipScalaTests test
   ```
   
   ### Documentation Update
   
   None.
   
   ### Contributor's checklist
   
   - [ ] 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to