zhangshenghang opened a new pull request, #11525:
URL: https://github.com/apache/seatunnel/pull/11525
## Purpose of the change
Fixes #9889.
Configuring the ClickhouseFile sink exactly as documented fails at startup:
```
FactoryException: Unable to create a sink for identifier 'ClickhouseFile'
```
## Root cause
The documentation describes `node_pass` entries with snake_case keys:
```hocon
node_pass = [{
node_address = "xxx"
password = "xxx"
}]
```
but `NodePassConfig` declares the field `nodeAddress` with no Jackson
mapping. `ReadonlyConfig` converts option values with a **plain
`ObjectMapper`** (no snake_case naming strategy), so deserializing the
documented configuration throws:
```
UnrecognizedPropertyException: Unrecognized field "node_address"
(class ...NodePassConfig), not marked as ignorable
(2 known properties: "nodeAddress", "password"])
```
## Changes
- **`NodePassConfig`**
- `@JsonProperty("node_address")` on `nodeAddress`, with
`@JsonAlias("nodeAddress")` so users who already write the camelCase form keep
working.
- Added the documented `username` field (`node_pass.username`, per the
docs table), so entries containing it no longer fail deserialization either.
- **`NodePassConfigTest`** (new)
- `testNodePassConfigParsesDocumentedSnakeCaseKeys` — goes through the
real `ReadonlyConfig.get(NODE_PASS)` conversion path with
`node_address`/`username`/`password` and asserts all fields. Without the fix it
reproduces the exact `UnrecognizedPropertyException` from the issue (verified
by running the test against the unfixed class).
- `testNodePassConfigAcceptsCamelCaseAlias` — `nodeAddress` keeps working.
## Verification
- `./mvnw -pl seatunnel-connectors-v2/connector-clickhouse test` — full
module suite passes.
- Behavioral repro confirmed: with the fix stashed, the snake_case test
fails with `Unrecognized field "node_address"`; with the fix, both tests pass.
--
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]