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

   ### Purpose of this pull request
   
   Closes #12191.
   
   The LLM transform currently converts results such as `"unknown"`, an empty 
string, or a null element to `false` when `output_data_type = BOOLEAN`. A 
downstream validator cannot distinguish those results from a genuine `false` 
after conversion.
   
   This proposes an optional strict validation mode at the conversion boundary, 
while preserving the existing default behavior.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Add `strict_boolean_output`, defaulting to `false`.
   
   ```hocon
   output_data_type = BOOLEAN
   strict_boolean_output = true
   ```
   
   When enabled for BOOLEAN output, require exactly one non-null `true` or 
`false` result, matching case-insensitively without trimming whitespace. 
Invalid, empty, null, or multiple results fail with a validation error that 
does not include the input row or model response.
   
   Existing defaults, capitalized boolean support, custom-provider response 
parsing, and other output types are unchanged. This does not add retries, row 
skipping, or error-table routing. English and Chinese documentation describe 
the option and its limits.
   
   The transform retains its baseline serialization identifier so previously 
serialized job metadata remains readable; older payloads keep strict validation 
disabled.
   
   ### How was this patch tested?
   
   - Added 41 regression cases covering default compatibility, valid literals, 
malformed/null/empty/multiple results, sanitized errors, non-BOOLEAN output 
types, row metadata, custom-provider response formats, the legacy serialization 
identifier, and factory-wrapper serialization roundtrips in default and strict 
modes.
   - Before implementation, the original 38-case fixture reproduced 13 expected 
failures on both Java 8 and Java 11. The added serialization identifier 
assertion also failed before preserving the baseline identifier.
   - Complete transform unit suite passed on Java 8 and Java 11: 1,150 tests on 
each runtime, with no failures, errors, or skips.
   - A separate manual compatibility probe serialized the actual factory 
wrapper with baseline classes, then read those archived bytes with the updated 
classes on Java 8 and Java 11. A malformed boolean response still produced 
`false` through the local HTTP provider. This old-payload check is separate 
from the checked-in roundtrip tests; no full cluster-upgrade test was run.
   - No external model service was used.
   - Root `./mvnw spotless:apply` passed.
   - Full-repository `./mvnw -q -DskipTests verify` passed on Java 11 at the 
final revision. This build skips tests and is separate from the transform 
unit-suite results above.
   
   ```shell
   ./mvnw -f seatunnel-transforms-v2/pom.xml -Dskip.spotless=true test
   ```
   
   ### Check list
   
   * [x] If any new Jar binary package adding in your PR, please add License 
Notice according
     [New License 
Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/developer/new-license.md)
 — N/A: no new dependencies or JARs.
   * [x] If necessary, please update the documentation to describe the new 
feature. https://github.com/apache/seatunnel/tree/dev/docs — EN/ZH updated.
   * [x] If necessary, please update `incompatible-changes.md` to describe the 
incompatibility caused by this PR. — N/A: existing defaults and APIs are 
preserved.
   * [x] If you are contributing the connector code, please check that the 
following files are updated: — N/A: not a connector change.
     1. Update 
[plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties)
 and add new connector information in it
     2. Update the pom file of 
[seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
     3. Add ci label in 
[label-scope-conf](https://github.com/apache/seatunnel/blob/dev/.github/workflows/labeler/label-scope-conf.yml)
     4. Add e2e testcase in 
[seatunnel-e2e](https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/)
     5. Update connector 
[plugin_config](https://github.com/apache/seatunnel/blob/dev/config/plugin_config)
   


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