vinishjail97 opened a new pull request, #17863:
URL: https://github.com/apache/hudi/pull/17863
### Describe the issue this Pull Request addresses
Adds validation to detect and reject invalid write stats with zero operation
counts, preventing inconsistent metadata from being committed.
### Summary and Changelog
- Added `validateWriteStats()` method to validate write stats before
finalizing writes
- Validates that at least one of `numWrites` or `numDeletes` is non-zero
- Throws `HoodieInconsistentMetadataException` when both counts are zero
- Added comprehensive test coverage for validation scenarios
### Impact
- Adds fail-fast validation for inconsistent write stats
- No breaking changes - only rejects invalid operations that shouldn't
succeed anyway
- Improves error messages for easier debugging
### Risk Level
**Low**
New validation catches edge cases that would have caused issues downstream.
No impact on valid operations.
### Documentation Update
Added Javadoc explaining the validation. No other documentation changes
needed.
### Contributor's checklist
- [x] 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]