goutamadwant opened a new pull request, #12285:
URL: https://github.com/apache/seatunnel/pull/12285
### Purpose of this pull request
Related to #9785.
Support scalar `TIMESTAMP_TZ` values when writing to existing ClickHouse
`DateTime`/`DateTime64` columns. The current sink sends these values through
`Timestamp.valueOf`, which rejects offset-bearing timestamps.
Bind UTC timestamp text with an explicit UTC SQL conversion, using the
target column's precision. Apply the same conversion to insert, update, delete
and existence-check parameters. This also avoids losing the distinction between
the two instants in a daylight-saving overlap in the pinned driver's temporal
binding.
### Does this PR introduce _any_ user-facing change?
Yes. Scalar offset timestamps now preserve their instant and the target
precision, including nullable columns and timezone-aware keys.
Existing jobs without `TIMESTAMP_TZ` retain their SQL and bindings. Jobs
containing these fields use SQL-based batching instead of the driver's binary
insert path; no throughput equivalence is claimed. Automatic table creation,
source inference and nested timezone-aware timestamps remain outside this
change. No dependencies or configuration defaults change. EN/ZH documentation
is updated.
### How was this patch tested?
- Reproduced the original failure through the sink factory, default
save-mode handler and real writer against ClickHouse 23.3.13.6.
- Java 8 and Java 11: all 48 connector unit tests and the selected
`ClickhouseOffsetTimestampIT` pass; both-module `verify` and Spotless pass.
- Server-side epoch assertions cover offsets, different column timezones,
seconds/microseconds/nanoseconds, nulls and both DST-overlap instants.
- Mixed-row checks cover escaped strings, decimals, arrays, local timestamps
and the unchanged driver's `Timestamp` behavior. A second writer verifies
existence checks, updates and deletes using a timezone-aware key.
Run with Java 8 or 11 and Docker available:
```sh
mvn -o -pl
seatunnel-connectors-v2/connector-clickhouse,seatunnel-e2e/seatunnel-connector-v2-e2e/connector-clickhouse-e2e
\
verify -DskipIT=false -Dit.test=ClickhouseOffsetTimestampIT
-DfailIfNoTests=false \
'-Dsurefire.jvm.args=-Xmx512m -Dapi.version=1.44
-Duser.timezone=America/Los_Angeles'
```
This covers the connector's real factory/writer path, not a full engine job
or the complete E2E matrix.
### Check list
- [x] No new JAR dependencies; no license/notice additions needed.
- [x] EN/ZH connector documentation updated.
- [x] No incompatible changes to existing supported types; no
`incompatible-changes.md` update needed.
- [x] Existing connector only; plugin mapping, distribution, CI labels and
plugin configuration are unchanged. Unit and connector E2E regression tests are
included.
--
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]