yihua opened a new pull request, #18396: URL: https://github.com/apache/hudi/pull/18396
### Describe the issue this Pull Request addresses Custom merge handle implementation needs input data characteristics such as updates to determine different strategies. Such characteristics is known based on the workload profiling, but not visible to the merge handle. ### Summary and Changelog This PR makes the changes so that the merge handle knows the number of updates from workload profiling: - Propagates the number of update records per file from workload profiling (tagging) through `BucketInfo` → `UpsertPartitioner` → `handleUpdate` → `HoodieMergeHandleFactory` → merge handle constructors, so merge handles know the expected number of incoming updates at construction time. - Introduces `MergeContext<T>` to wrap `numIncomingUpdates` and the record iterator into a single context object, replacing loose constructor parameters across the merge handle class hierarchy. - Adds `numUpdates` field to `BucketInfo` (default `-1` for unknown/legacy callers) and `numIncomingUpdates` field to `HoodieAbstractMergeHandle` (via `MergeContext`), threaded through all subclasses (`HoodieWriteMergeHandle`, `FileGroupReaderBasedMergeHandle`, `HoodieSortedMergeHandle`, `HoodieMergeHandleWithChangeLog`, `HoodieSortedMergeHandleWithChangeLog`, `HoodieConcatHandle`). For now, only Spark side has the number of updates propagated. - Uses `MergeContext.class` in the reflection-based `constructorParamTypes` in `HoodieMergeHandleFactory` to match the refactored constructor signatures. ### Impact Merge handle implementation can use the number of updates for different strategies. ### Risk Level none ### Documentation Update none ### Contributor's checklist - [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute) - [ ] Enough context is provided in the sections above - [ ] 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]
