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

   ### Purpose of this pull request
   
   Fixes #12363.
   
   Rebuild Replace's configured field indexes in the existing schema-refresh 
hook. Constructor-time indexes otherwise survive reordered schemas and can 
apply replacements to the wrong columns after schema events, restoration or 
input handoff.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Replace now follows configured field names after supported 
schema-layout changes. For example, restoring `id,name,title` as 
`title,id,name` no longer leaves title unchanged while processing the old 
offsets.
   
   Missing configured targets fail with the existing validation error during 
schema refresh, rather than processing rows with stale bindings. This failure 
is outside row-level skip handling. No options, public APIs or checkpoint 
formats change. Existing literal/regex behavior, null handling and input-row 
isolation are preserved. EN/ZH documentation explains the corrected behavior 
and target-name requirement.
   
   This does not add general schema-evolution support to every engine or change 
non-string conversion/chained-rename behavior. Field lookup is performed on 
schema refresh, not per row.
   
   ### How was this patch tested?
   
   - Baseline restore/handoff regressions failed before the fix on Java 8 and 
Java 11. Java 11 executed the compiled baseline with installed prerequisite 
snapshots; it was not a fresh Java 11 baseline reactor.
   - Extended ReplaceTransformTest for restoration, input handoff, 
add/drop/reorder, missing targets, nulls, row metadata, input preservation, 
multi-table routing and ALL_MATCH chains.
   - Full transform suites passed on Java 8u172 and Java 11.0.19: 1,165 tests 
each, zero failures/errors/skips.
   - Added 
`MysqlCDCWithSchemaChangeIT#testReplaceFieldBindingAfterSchemaChangeAndRestore`:
 real MySQL 8.0.43 snapshot, leading-column addition, savepoint, stopped-source 
DML and restoration passed, including untouched-field assertions. Engine Java 
8u342; Java 11 host driver. Runtime artifacts were freshly built and 
hash-checked; host harness dependencies included installed snapshots. This is 
fixed-runtime evidence, not a live unchanged/fixed pair or engine-Java-11 
recovery test.
   - Spotless passed. A combined integration tree containing this fix and the 
separate exact-array-extrema fix passed the 310-module Java 11 `verify 
-DskipTests -Dskip.ui=true` build. Repository-wide test execution is not 
claimed.
   
   Focused test command, with the selected JDK in JAVA_HOME:
   
   ```sh
   ./mvnw -B -pl seatunnel-transforms-v2 -am package \
     
'-Dtest=ReplaceTransformTest,ReplaceTransformFactoryTest,AbstractMultiCatalogTransformTest,TransformChainLiveAlterTest,ProductionPipelineSchemaChangeTest,ChainTimestampPreservationTest'
 \
     -Dsurefire.failIfNoSpecifiedTests=false -Dskip.ui=true
   ```
   
   ### Check list
   
   - [x] Regression coverage added to existing unit and MySQL CDC E2E tests.
   - [x] EN/ZH Replace documentation updated.
   - [x] EN/ZH incompatible-change notes updated.
   - No new JAR dependencies or connector registration changes.
   


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