danny0405 opened a new pull request, #19354:
URL: https://github.com/apache/hudi/pull/19354
### Describe the issue this Pull Request addresses
The Flink write-client layer had substantial coverage gaps around COW/MOR
writes, CDC merge handles, write-handle selection, table-service routing,
delete tagging, and clustering-plan scheduling. These gaps left retry cleanup,
commit metadata, and several error paths unverified.
While adding delete-helper coverage, the global-index deduplication path was
found to build a set from all record keys before filtering, which caused every
input key—including duplicates—to be retained.
### Summary and Changelog
- Add functional Flink write-client tests for COW and MOR tables with CDC
enabled and disabled.
- Exercise insert, upsert, delete records, prepped writes, retry cleanup,
base-file create/merge handles, and commit metadata assertions.
- Add clustering scheduling coverage using
`FlinkSizeBasedClusteringPlanStrategyRecently`.
- Add focused action-routing tests for COW/MOR commit, compaction, log
compaction, rollback, cleaning, clustering, and unsupported entry points.
- Add write-handle factory coverage for commit, clustering, CDC,
file-group-reader, metadata-table, and RowData log handles.
- Fix global delete-key deduplication to retain only the first key
occurrence; preserve deterministic order for partitioned-index deduplication.
- No code was copied.
| Class | Before | After |
|---|---:|---:|
| `HoodieFlinkWriteClient` | 62% | 76.0% |
| `FlinkSizeBasedClusteringPlanStrategyRecently` | 0% | 84.8% |
| `FlinkDeleteHelper` | 0% | 100.0% |
| `HoodieFlinkCopyOnWriteTable` | 28% | 75.0% |
| `FlinkMergeHandle` | 35% | 82.5% |
| `FlinkCreateHandle` | 47% | 88.2% |
| `FlinkWriteHandleFactory` | 67% | 77.1% |
| `FlinkMergeHandleWithChangeLog` | 0% | 75.0% |
| `FlinkIncrementalMergeHandleWithChangeLog` | 0% | 96.6% |
| `HoodieFlinkTableServiceClient` | 68% | 75.6% |
| `HoodieFlinkMergeOnReadTable` | 61% | 77.4% |
The after values are from the clean `hudi-flink-client` JaCoCo line report.
### Impact
No public API, configuration, storage-format, or performance changes. The
behavioral change is limited to correctly deduplicating global-index delete
keys before tagging and writing them.
### Risk Level
low
The production change is a small correction to key deduplication, covered by
global and partitioned index tests. The broader change set is test-only and
confined to `hudi-flink-client`.
Validated with:
```bash
mvn -q -pl hudi-client/hudi-flink-client -Punit-tests \
-DskipITs -DskipUTs=false -Drat.skip=true clean test
```
`git diff --check` and module checkstyle also pass.
### Documentation Update
none — no public API, configuration, or user-facing feature changed.
### 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]