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

   <!-- PR title: [Fix][Transform-V2] Validate array length by element count -->
   
   ### Purpose of this pull request
   
   Fixes #12319.
   
   Use `Array.getLength` for array values in DataValidator's LENGTH rule. 
Non-byte arrays currently fall through to Java identity-string length, causing 
valid array-valued rows to fail validation.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. An `Integer[] {10, 20}` now passes `exact_length = 2`. Validation 
counts outer array elements, including nulls, without traversing nested arrays. 
Genuinely invalid lengths still follow the configured FAIL, SKIP or 
ROUTE_TO_TABLE policy.
   
   Review thresholds adjusted to the old behavior and previously skipped/routed 
data before replay. Byte-array, String UTF-16 length, Collection, null and 
fallback behavior remain unchanged. No new options, defaults, public APIs, 
schemas or state formats. EN/ZH documentation and upgrade notes are included. 
The defect was verified on unreleased dev; released-version coverage has not 
been established.
   
   ### How was this patch tested?
   
   - All 23 new regression cases pass on Java 8 and Java 11; the valid-array 
contract fails against unchanged production code.
   - Coverage includes primitive/object/nested/empty arrays, boundaries, custom 
messages and all three transform-level error policies.
   - Full transform suite: 1,180 cases passed on each JDK on base 
`0d9f9e2303da`.
   - Root `./mvnw -q -DskipTests verify` and Spotless passed on Java 11 on that 
base.
   - After rebasing onto `f4a9665e8457`, all 39 DataValidator tests and 
formatting checks passed on Java 8 and Java 11. Production and test changes are 
unchanged from the broader validation.
   - The initial broader Java 8 run hit an unrelated Python executable-path 
mismatch. Aligning PATH resolved it; all transform tests were rerun. Only an 
already-passing dependency date/time performance method was omitted from that 
retry. Java 11 had no exclusions.
   - Docker-backed E2E tests were not run.
   
   Focused regression command:
   
   ```sh
   ./mvnw -B -pl seatunnel-transforms-v2 -am package \
     -Dtest=DataValidatorArrayLengthTest 
-Dsurefire.failIfNoSpecifiedTests=false -Dskip.ui=true
   ```
   
   ### Check list
   
   - [x] No new JAR dependencies or license notices required.
   - [x] English and Chinese documentation updated.
   - [x] `incompatible-changes.md` updated in both languages.
   - [x] Connector checklist not applicable: no connector code, registration, 
distribution dependencies or plugin configuration changed.
   


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