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

   Fixes #12796
   
   ### Purpose of this pull request
   
   `--check`, `--dry-run static|connect` and the Flink/Spark config validation 
call `ConfigValidator#validateUnknownKeys`, which accepts only keys declared in 
the connector's `OptionRule`. The Jdbc factories did not declare several 
documented options that the connector reads, so valid configs were rejected, 
for example:
   
   ```
   Connector 'Jdbc' has unknown option keys: [table]. Please check for typos.
   ```
   
   This PR declares them as optional options:
   
   - `JdbcSinkFactory`: `table`, `schema`, `properties`, `connect_timeout_ms`, 
`socket_timeout_ms`, `decimal_type_narrowing`, `int_type_narrowing`, 
`handle_blob_as_string`, `use_kerberos`, `kerberos_principal`, 
`kerberos_keytab_path`, `krb5_path`, `access_key_id`, `secret_access_key`, 
`region`. All of them are read by `JdbcSinkConfig#of`, 
`JdbcConnectionConfig#of` or `JdbcSinkFactory`.
   - `JdbcSourceFactory`: `connect_timeout_ms`, `socket_timeout_ms`, 
`handle_blob_as_string`, `use_kerberos`, `kerberos_principal`, 
`kerberos_keytab_path`, `krb5_path`. They are read by the shared 
`JdbcConnectionConfig#of` and documented in `docs/en/connectors/source/Jdbc.md`.
   
   Impact checked:
   
   - `OptionRule.Builder` duplicate checks: none of these options appears 
elsewhere in either rule.
   - `SeaTunnelConfValidateCommand#validateOptionTypes` now type-checks these 
keys. All of them are scalar or `Map<String, String>`, the same types the 
connector already reads at runtime, so a config that runs also passes the check.
   - The REST `option-rules` service and the metadata export now list these 
options, which matches the docs.
   - Runtime behavior does not change: the options were already read at job 
submission, only the declarations were missing.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Configs using these documented options no longer fail `--check` / 
`--dry-run` with an unknown-key error. Truly unknown keys are still rejected.
   
   ### How was this patch tested?
   
   - Added `JdbcSinkFactoryTest#testDocumentedSinkOptionsAreNotUnknownKeys`, 
`#testUndeclaredSinkOptionIsUnknownKey` and 
`JdbcSourceFactoryTest#testDocumentedSourceOptionsAreNotUnknownKeys`.
   - `./mvnw -pl seatunnel-connectors-v2/connector-jdbc test` on JDK 17: all 
tests pass.
   - On a deployed Zeta cluster, `bin/seatunnel.sh --check` and `--dry-run 
static|connect` with a Jdbc sink that sets `table` were rejected before this 
change and pass after it.
   
   ### Check list
   
   * [ ] 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)
   * [x] If necessary, please update the documentation to describe the new 
feature. https://github.com/apache/seatunnel/tree/dev/docs (not needed, the 
options are already documented)
   * [x] If necessary, please update `incompatible-changes.md` to describe the 
incompatibility caused by this PR. (not needed)
   


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