hutiefang76 opened a new pull request, #12867:
URL: https://github.com/apache/seatunnel/pull/12867

   Yes, contributing this fix to Apache SeaTunnel.
   
   ### Purpose of this pull request
   
   Fixes #12864. Canal and Maxwell reconstructed update before-images using a 
recursive field-name search. A changed field in another Canal row, or inside a 
nested Maxwell field, could make an unchanged column in the current row become 
null.
   
   Check direct membership in the matching old row instead. Canal uses `old[i]` 
for `data[i]`; Maxwell checks only the top-level old fields. Explicit JSON 
nulls remain changed values and are not overwritten with after-image data.
   
   ### Does this PR introduce any user-facing change?
   
   Update before-images retain unchanged values correctly. For a two-row Canal 
update where only row 1 changes weight and row 2 changes name, both 
before-images now keep their own remaining values. A nested Maxwell field no 
longer changes an unrelated top-level field with the same name.
   
   No option, default, public API, dependency or timestamp handling changes.
   
   ### How was this patch tested?
   
   JDK 17.0.18:
   
   - The new multi-row Canal and nested-field Maxwell cases fail before the 
fix; explicit-null controls pass before and after.
   - Affected Canal/Maxwell suites: 12 tests passed.
   - All JSON format suites: 59 tests passed, zero failures/errors/skips.
   - Scoped `spotless:apply`, build-time `spotless:check` and root `./mvnw -q 
-DskipTests verify` passed. Root verify skips test execution.
   - Independent review of the full four-file diff completed. Remote CI, 
maintainer review and merge remain separate.
   
   ```sh
   ./mvnw -B -pl seatunnel-formats/seatunnel-format-json -am \
     '-Dtest=org.apache.seatunnel.format.json.**.*Test' \
     -Dsurefire.failIfNoSpecifiedTests=false package
   ```
   
   ### Check list
   
   - [x] Regressions added to the existing Canal and Maxwell suites.
   - [x] Explicit-null behavior preserved.
   - [x] Formatting and required local verification completed.
   - No new dependencies or connector registration.
   
   <sub>Implementation and tests assisted by DeepSeek and Codex; this 
description was drafted and posted by an AI assistant for @hutiefang76.</sub>
   


-- 
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]

Reply via email to