fix(flink): improve read path coverage and CDC reliability - #19402
Open
cshuo wants to merge 3 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19402 +/- ##
============================================
+ Coverage 75.28% 75.35% +0.07%
- Complexity 32513 32544 +31
============================================
Files 2574 2574
Lines 142971 142995 +24
Branches 17525 17530 +5
============================================
+ Hits 107638 107760 +122
+ Misses 27279 27145 -134
- Partials 8054 8090 +36
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
cshuo
marked this pull request as ready for review
July 29, 2026 03:43
danny0405
reviewed
Jul 29, 2026
danny0405
left a comment
Contributor
There was a problem hiding this comment.
I found two correctness gaps in the new CDC coverage. Both can cause a reader task to hang or silently skip later changes.
cshuo
force-pushed
the
flink-read-path-coverage
branch
from
July 29, 2026 06:55
8e8c4e5 to
c3ab8ff
Compare
cshuo
force-pushed
the
flink-read-path-coverage
branch
from
July 30, 2026 01:35
c3ab8ff to
71f5f0a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the issue this Pull Request addresses
Closes #19401.
The Flink table-format and source-reader read paths lacked focused coverage for partition paths, CDC iteration, schema reconciliation, COW split planning, Lance reads, and source split-reader lifecycle behavior. The added CDC coverage also exposed two correctness gaps: an empty CDC file split could stop iteration before later changes, and truncated image bytes could cause an unbounded skip loop.
Summary and Changelog
TestHoodieRowDataLanceReaderfor metadata, row-key filtering, Arrow batch iteration, schema validation, and resource cleanup.CdcFileSplitsIteratoradvance through empty child iterators until it finds a row or exhausts all file splits.BytesArrayInputViewthrowEOFExceptionwhen truncated input prevents a requested skip from making progress.Targeted local JaCoCo line coverage:
FilePathUtilsCdcIteratorsCdcImageManagerCopyOnWriteInputFormatHoodieRowDataLanceReaderInternalSchemaManagerRecordIteratorsHoodieCdcSplitReaderFunctionHoodieSplitReaderFunctionExpressionEvaluatorsHoodieSourceIncrementalInputSplitsThe JaCoCo-enabled reactor run passed 212 tests with no failures, errors, or skips:
mvn -Punit-tests -Djacoco.skip=false \ -pl hudi-flink-datasource/hudi-flink -am \ -Dtest=TestFilePathUtils,TestCdcImageManager,TestCdcIterators,TestInternalSchemaManager,TestCopyOnWriteInputFormat,TestRecordIterators,TestHoodieSource,TestIncrementalInputSplits,TestExpressionEvaluators,TestHoodieSplitReaderFunction,TestHoodieCdcSplitReaderFunction,TestHoodieRowDataLanceReader,TestInputFormat \ -Dsurefire.failIfNoSpecifiedTests=false \ -DskipITs -DskipSparkTests -DskipScalaTests testImpact
EOFExceptioninstead of hanging.Risk Level
Low. The production changes are limited to CDC iterator boundary handling and an EOF guard. The affected classes and source-reader caller were covered by targeted tests, and the complete 212-test JaCoCo run passed.
Documentation Update
None.
Contributor's checklist