goutamadwant opened a new pull request, #12686:
URL: https://github.com/apache/seatunnel/pull/12686
### Purpose of this pull request
Related to #10681. This implements the ClickHouse sink slice of Layer 1
connectivity validation without changing `DryRunConnectValidator` or the shared
validation interfaces.
The sink factory implements `SupportSinkDryRunValidation` and checks the
first configured host through a read-only, parameter-bound query against
`system.tables`.
The check:
- Uses the sink's connection settings without creating a writer or executing
save modes.
- Requires a visible target table when `schema_save_mode` is
`ERROR_WHEN_SCHEMA_NOT_EXIST`.
- Allows a missing target for other schema save modes without creating a
database or table.
- Caps connection, socket and server-query timeouts, preserves shorter
positive values, disables retries/failover and avoids reusing a configured
session.
- Closes client and response resources and reports validation errors without
retaining driver exception details.
### Does this PR introduce _any_ user-facing change?
Yes, compared with current `dev`.
**Before:** ClickHouse sink connectivity validation is reported as `SKIPPED`.
**After:** `--dry-run connect` validates the initial host's metadata
connection and reports connection, authentication or required-target failures
before job submission.
The check does not read business rows, execute `custom_sql`, create tables
or write data. Success does not prove field compatibility, write/DDL
permissions, data-save-mode conditions or connectivity to every shard.
Dry-run rejects custom HTTP parameters, a custom `X-ClickHouse-Query-Id`
header and credential combinations that the existing sink would resolve to a
different account. These restrictions are documented in English and Chinese.
Normal job execution, existing configuration defaults, ClickHouse source and
ClickHouseFile sink are unchanged. No new dependencies or public API changes
are introduced.
### How was this patch tested?
The new capability test failed against the unchanged factory before
implementation.
Validated on both Java 8 and Java 11:
- ClickHouse connector: 58 unit tests passed.
- Focused container-backed ClickHouse integration tests: 3 passed.
- Shared API and connector-common suites: 407 tests passed per Java version.
Coverage includes metadata-only requests, timeout limits, resource cleanup,
interruption, authentication failures, missing targets, schema save modes and
preservation of existing data under destructive save-mode configurations.
With the required project dependencies installed:
```bash
mvn -B -ntp -pl seatunnel-connectors-v2/connector-clickhouse clean install
mvn -B -ntp \
-pl seatunnel-e2e/seatunnel-connector-v2-e2e/connector-clickhouse-e2e \
clean -DskipUT -DskipIT=false \
'-Dit.test=ClickhouseIT#testSinkConnectDryRun*' verify
```
Formatting and packaging verification passed for the connector and its
integration-test module. The full repository and multi-engine integration
matrix were not run.
### Check list
- [x] New Jar binary packages and license notices checked: no new
dependencies.
- [x] English and Chinese connector documentation and dry-run support
matrices updated.
- [x] Incompatible changes checked: normal execution and configuration
contracts are unchanged; dry-run scope and restrictions are documented.
- [x] Connector integration requirements checked:
1. `plugin-mapping.properties`: unchanged; existing connector.
2. `seatunnel-dist/pom.xml`: unchanged; existing connector.
3. CI label configuration: unchanged; existing connector.
4. Existing ClickHouse integration-test class extended.
5. `config/plugin_config`: unchanged; existing connector.
--
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]