hutiefang76 opened a new pull request, #4408: URL: https://github.com/apache/amoro/pull/4408
## Why are the changes needed? Fix #4407. `HudiTableDescriptor.getSnapshots` casts the long total file size to int before assigning it to a long field. A 3 GiB snapshot therefore becomes -1073741824 bytes instead of 3221225472 bytes. Larger values can also wrap to a smaller positive size. ## Brief change log Remove the narrowing int cast. Add size-boundary regressions, including Integer.MAX_VALUE, 2 GiB, 3 GiB and 5 GiB, plus field-mapping, operation-filtering and empty-list coverage. ## How was this patch tested? - [x] Add regression tests covering the changed behavior. - [x] Run tests locally before making a pull request. The new suite has 10 test cases. On the original implementation, 4 size assertions fail; with the change all 10 pass. ```shell ./mvnw -B -ntp -Pjava11 -pl amoro-format-hudi -am -Dsurefire.failIfNoSpecifiedTests=false -Dtest=TestHudiTableDescriptorSnapshots test ``` The selected suites passed on Java 11 and Java 17: 10 tests per JDK, with no failures, errors or skips. The Java 17 run used a clean build and the `java17` profile. Spotless and Checkstyle checks passed. The full test suite and browser tests were not run. ## Documentation - Does this pull request introduce a new feature? no - How is the feature documented? not applicable Code was assisted by DeepSeek v4 Flash via Reasonix 1.39.4; submission text was assisted by Codex. The patch and local test results were reviewed. -- 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]
