You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "DanielLeens (via GitHub)" <gi...@apache.org> on 2026/07/18 13:47:38 UTC

[PR] [Feature][Connector-V2] Support remaining JDBC TIMESTAMP_TZ types [seatunnel]

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

   ## Purpose
   
   Complete the remaining JDBC connector coverage for SeaTunnel `TIMESTAMP_TZ`.
   
   Closes #9785.
   
   ## Changes
   
   - map JDBC 4.2 `TIMESTAMP_WITH_TIMEZONE` to `OFFSET_DATE_TIME` in the generic converter
   - support native timezone timestamp metadata from Db2 for z/OS, Presto, Teradata, and Vertica
   - preserve the Db2 `DBTimestamp` offset through `toDBString(true)` and truncate fractional precision beyond nanoseconds
   - recognize proprietary JDBC codes through native type names in the legacy metadata fallback
   - exercise Presto source discovery and offset-preserving value reads against a real Presto container
   - document source and sink behavior in English and Chinese
   
   Existing timezone-aware sink columns continue to use JDBC `setObject` with `OffsetDateTime`. Auto table creation remains limited to dialects that provide the corresponding catalog/type conversion. No configuration, public API, or dependency changes are introduced.
   
   ## Verification
   
   - `./mvnw spotless:apply -nsu -Dmaven.gitcommitid.skip=true -T 3C`
   - 41 focused JDBC unit tests: passed
   - `JdbcPrestoIT#testTimestampWithTimeZoneMappingAndValue` with a real Presto container: passed
   - `env -u SEATUNNEL_HOME ./mvnw -q -DskipTests verify -nsu -Dmaven.gitcommitid.skip=true -T 3C`: passed
   
   The full local multi-engine Presto E2E suite was also attempted, but Docker Desktop had only 2915 MB available and killed the Presto container while engine containers were starting. The isolated real-Presto metadata/value integration test passed.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support remaining JDBC TIMESTAMP_TZ types [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11485:
URL: https://github.com/apache/seatunnel/pull/11485#issuecomment-5287979075

   Seventh-round self-review note: the head advanced from `6c4babb8d` (my 2026-08-13 11:05 review) to `9f534f6800` (current), and per this repo's policy that a genuine new commit requires a fresh full re-review rather than a rubber-stamp, I re-derived the diff from scratch instead of assuming the new commit was a no-op.
   
   What I verified:
   
   1. **The new commit is a pure merge-sync with zero content change to this PR's diff.** `9f534f6800` is `Merge branch 'dev' into davidzollo_timestamp-tz-connectors-20260718`, bringing in roughly a dozen unrelated `dev` commits (doc improvements for other connectors, a Jackson shading fix, workflow changes). I diffed each of the 17 files this PR touches at both the old head (`dev...6c4babb8d`) and the new head (`dev...9f534f6800`) and compared the two diffs with git blob hashes and hunk line numbers stripped out: the content is byte-for-byte identical (`diff` reports no differences after normalizing `index` and `@@` lines). The only visible changes were hunk-header line-number shifts caused by unrelated upstream doc edits elsewhere in `docs/en/connectors/source/Jdbc.md` and `docs/zh/connectors/source/Jdbc.md`. `git diff apache/dev...9f534f6800 --stat` still reports the same 17 files, 315 insertions / 4 deletions as my last round.
   2. **Every source-level claim from my 2026-08-13 review still holds against the current head**, re-checked directly rather than trusted: `TeradataJdbcRowConverter.java` and `VerticaJdbcRowConverter.java` are both still bare 20-line passthrough classes overriding only `converterName()` — neither has a `TIMESTAMP_TZ` read/write override. `seatunnel-e2e/.../connector-jdbc-e2e-part-2/.../JdbcTeradataIT.java:37` is still `@Disabled("...needs user's personal teradata account...")`. So Issue 1 (High) — the Teradata/Vertica `TIMESTAMP_TZ` read path has no dialect override and its only fallback (`JdbcFieldTypeUtils.getOffsetDateTime`'s generic `Timestamp` branch) silently fabricates a UTC offset via `((Timestamp) obj).toInstant().atOffset(ZoneOffset.UTC)` on any string-parse miss, with zero test coverage for Teradata and zero *possible* CI coverage until that IT is re-enabled — is unchanged and still the sole blocker. Issues 2-5 (Medium/Low, sink-side conformance risk, doc overstatem
 ent, missing `PrestoDialect` comment, uncached reflection) are likewise unchanged; nothing in the diff moved.
   3. **No new community input to incorporate.** `gh api repos/apache/seatunnel/pulls/11485/reviews`, `.../comments`, and `repos/apache/seatunnel/issues/11485/comments` all still return only my own 6 prior self-reviews and zero comments from any other user.
   
   CI diagnosis (this round's real change): the apache-side "Build" check on the current head (`9f534f6800`) again shows `failure`. I traced the pointer to the actual fork run rather than trusting the badge: `repos/apache/seatunnel/check-runs/94444856847` points at `DanielLeens/seatunnel` run `31699053139` (attempt 1, completed). That run has exactly one failing job: `updated-modules-integration-test-part-1 (11, ubuntu-latest)`. The Maven failure is `connector-cdc-postgres-e2e` → `PostgresCDCIT.testPostgresCdcSnapshotOnlyAndCommittedOffsetStartupModes` → `ConditionTimeout` at line 629, an `await().atMost(120, TimeUnit.SECONDS)` waiting on a replication-slot restore after `savepointJob`/`restoreJob`. The test's own inline comment (`PostgresCDCIT.java:627-628`, on `dev`, pre-existing and untouched by this PR) says: "Restoring the checkpoint and reconnecting the existing replication slot can take longer on shared GitHub runners than the initial CDC startup" — i.e. this is a docume
 nted, known-flaky timing class of failure on shared runners, not a new regression. This module is pulled into the reactor because Postgres-CDC's sink side is JDBC-backed (`postgrescdc_to_postgres_with_debezium_to_kafka.conf` writes through the Postgres JDBC sink), so `connector-cdc-postgres-e2e` legitimately depends on `connector-jdbc` and gets included by `update_modules_check.py`. But none of the columns exercised in that test (`f_big`, plain CDC row fields) are `TIMESTAMP_TZ`-typed, and this PR only touches the `TIMESTAMP_TZ`-specific branches of `GenericTypeConverter`, `JdbcColumnConverter`, `DB2TypeConverter`, `PrestoTypeMapper`/`PrestoDialect`, `TeradataTypeMapper`, `VerticaTypeMapper`, and `JdbcFieldTypeUtils.getOffsetDateTime` — none of which are on the code path a checkpoint/restore/replication-slot test exercises. I confirmed no other job in the fork run failed (single failing job, single attempt). Conclusion: the current CI red is a real failure, but it is unrelated to 
 this PR's diff and does not add a new blocker beyond Issue 1; it should be retried at the job level rather than treated as evidence against this PR.
   
   Conclusion: Ready to merge after fixes still stands, unchanged from 2026-08-13. The one Blocker (Issue 1, High — implement real `TeradataJdbcRowConverter`/`VerticaJdbcRowConverter` `TIMESTAMP_TZ` read overrides with driver-mocked test coverage, or scope Teradata/Vertica out of this PR's mapper and docs until that lands) remains open and unaddressed in the current head. As the author, this self-review records a technical conclusion only and does not count toward the approval gate; a write-capable maintainer still needs to review, and Issue 1 should be resolved before merge regardless of CI outcome on the unrelated Postgres-CDC timing failure.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support remaining JDBC TIMESTAMP_TZ types [seatunnel]

Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #11485:
URL: https://github.com/apache/seatunnel/pull/11485#issuecomment-6538592510

   Merged `dev` (`3ac2d1cec6a`) into this branch with a plain merge commit (no rebase, no force push). New head: `20808462f06` (previous head `691c50090b`). Only formatting was run locally (module-scoped `spotless:apply`); `git diff origin/dev --name-status` lists only this PR's own 17 files and no deletions.
   
   Conflicts and resolution:
   - `JdbcFieldTypeUtils.java`: import-only conflict, kept `javax.annotation.Nullable` (from `dev`) and `java.lang.reflect.Method` (this PR).
   - `JdbcFieldTypeUtilsTest.java`: kept both the `DBTimestamp` import and `BigDecimal` import, and both test groups (this PR's Db2 `DBTimestamp` test and `dev`'s `getBigDecimal` tests), closing the adjacent methods properly. No assertion was removed or changed.
   - The four connector docs merged without conflict.
   
   PR description: added a short "Behavior change" paragraph acknowledging, as requested in the 2026-09-14 review (Issue 1), that mapping the generic JDBC `TIMESTAMP_WITH_TIMEZONE` type code to `TIMESTAMP_TZ` in `JdbcColumnConverter` is an intentional type-mapping correction; the rest of the description is unchanged.
   
   Compile and tests are left to the fork CI run per the validation policy (queued at the time of writing, no result claimed): https://github.com/DanielLeens/seatunnel/actions/runs/41164811654
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support remaining JDBC TIMESTAMP_TZ types [seatunnel]

Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #11485:
URL: https://github.com/apache/seatunnel/pull/11485#issuecomment-6646523419

   The CI fact cited previously has changed: exact-head fork Build 41164811654 is now successful, superseding the earlier unfinished-run guidance. Apache's current rollup is still empty. The existing source/documentation requests remain open; success does not clear them or provide independent approval. Please complete those focused changes rather than retrying the already-green fork run. I am the author and cannot approve this PR.
   
   CI reference: [Build 41164811654](https://github.com/DanielLeens/seatunnel/actions/runs/41164811654).
   
   This updates CI/merge facts on the already-reviewed head; it is not another full source review. No local runtime testing was performed. Daniel has READ permission; effective maintainer approval/dismissal remains separate.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support remaining JDBC TIMESTAMP_TZ types [seatunnel]

Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #11485:
URL: https://github.com/apache/seatunnel/pull/11485#issuecomment-7044880279

   A merge-gate correction for unchanged head `5e709220d7a5bb72d46729b859063d49d3d228c2`: GitHub now reports actual content conflicts with current dev. My earlier gate description did not record that conflict. The current comparison is `diverged`, ahead 13 / behind 43. Please resolve the content conflicts against current dev and obtain checks for the resulting head before merge. The previously identified IRIS fixture failure and upstream #13285 synchronization guidance remain applicable; a conflict resolution alone is not proof the rerun passed. This is a real conflict gate, not a synchronization request merely because the branch is behind. It adds no new numbered source finding, and does not claim a base sync repairs an unrelated CI failure. Effective approval/merge controls still belong to a write-capable maintainer. No local build or test was run.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support remaining JDBC TIMESTAMP_TZ types [seatunnel]

Posted by "davidzollo (via GitHub) via commits" <co...@seatunnel.apache.org>.
davidzollo commented on PR #11485:
URL: https://github.com/apache/seatunnel/pull/11485#issuecomment-6703574574

   <!-- daniel-pr-followup-20261107 -->
   Yes, contributing to Apache SeaTunnel.
   
   Pushed `bc795d7f30674ebb8a9caf3391a6be4cfb1c5ac4` by normal fast-forward push. Reconciled the JDBC mapping documentation conflict, retained CockroachDB coverage, and documented the TIMESTAMP_TZ/OffsetDateTime migration and UTC instant-only fallback in English and Chinese. Added focused lifecycle/conversion Javadocs.
   
   Validation: affected-module Spotless and diff whitespace checks passed; an independent maintainer source review of these deltas completed. No local compile, unit, integration, E2E, Docker or service execution was performed under the repository validation policy. No engine UI change or existing runtime artifact was used. The current-head [fork Build](https://github.com/DanielLeens/seatunnel/actions/runs/42346229474) was queued at the post-push inspection; this update does not claim runtime correctness or merge readiness. This supersedes earlier verification statements for the previous head.
   
   Existing connector registrations, configuration defaults, public contracts and prior test assertions were retained. Upstream-only POM changes in the approved conflict merges match dev exactly; no new dependency edits were made. Human review and any remaining explicit coverage/acceptance gaps are separate gates.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support remaining JDBC TIMESTAMP_TZ types [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11485:
URL: https://github.com/apache/seatunnel/pull/11485#issuecomment-5350342350

   Eleventh-round self-check, against the current head `9f534f6800ad6f1a476452e56511bb167726734b` — still byte-identical to the version my last full review (2026-08-16) and the tenth-round self-check covered: same 17 files, same `+315/-4` diff stat against the merge base, no new commit and no new discussion since then. Re-deriving and re-posting the same full issue list against an unchanged version wouldn't add anything, so this is a live re-verification of the two open blockers plus current CI/merge health rather than a full rewrite:
   
   - **Issue 1 (High, still open)** — `JdbcFieldTypeUtils.getOffsetDateTime()`'s `Timestamp` branch (`seatunnel-connectors-v2/connector-jdbc/.../utils/JdbcFieldTypeUtils.java`) is the only value-read path Teradata and Vertica `TIMESTAMP_TZ` columns go through (neither driver returns `OffsetDateTime`/`ZonedDateTime`/`Instant`, or a recognizable proprietary wrapper class like Db2's `DBTimestamp`, so both fall into the generic `Timestamp` branch). On a string-parse failure that branch silently falls back to `((Timestamp) obj).toInstant().atOffset(ZoneOffset.UTC)` — the comment right above it even says this "may shift by JVM offset" — yet the result is stamped with a hard-coded `+00:00` offset regardless of the JVM's actual zone or the column's real stored offset. For a connector whose entire purpose is "don't lose the timezone," fabricating an offset on the failure path is a correctness regression with no logging and no test covering it (Teradata isn't in this repo's CI at all, an
 d the Vertica type-mapping test only checks metadata mapping, not the parsed value).
   - **Issue 2 (Medium, still open)** — `TeradataTypeMapper.mapping()` and `VerticaTypeMapper.mapping()` `switch` on the raw, unstripped `getColumnTypeName()` string (`TERADATA_TIMESTAMP_WITH_TIME_ZONE = "TIMESTAMP WITH TIME ZONE"`, `VERTICA_TIMESTAMP_WITH_TIME_ZONE` likewise), with no precision-stripping like `PrestoTypeMapper` added in this same PR (`columnType.startsWith(...) && columnType.contains("WITH TIME ZONE")`). If either driver reports the realistic `TIMESTAMP(n) WITH TIME ZONE` form — which is exactly the form `JdbcColumnConverter`'s new regex fallback in this same PR was written to handle — the switch falls to `default`, which throws `CommonError.convertToSeaTunnelTypeError(...)`, a `SeaTunnelRuntimeException`. That's not an `UnsupportedOperationException`, so `CatalogUtils.getTableSchema()`'s `catch (UnsupportedOperationException e)` fallback to `JdbcColumnConverter.convert()` never triggers — the job fails hard on the `query =` discovery path instead of silentl
 y degrading.
   
   What I re-verified live this round rather than trust the prior snapshot:
   
   **CI** — unchanged, still fully green (`Build`, `Notify test workflow`, `labeler` all pass on this SHA).
   
   **Merge state** — still `mergeable_state=dirty` / `CONFLICTING`. The divergence from `dev` has grown since the last check: `ahead_by=5`, `behind_by=45` (was `behind_by=41` a few days ago). This branch needs a rebase before it can be merged regardless of the two issues above, and the gap is only getting wider the longer it sits.
   
   ### Conclusion: Not recommended for merge
   
   Both previously-identified blockers are still unaddressed in this exact diff, and the branch is now further behind `dev` than before. Recommended next step is the same as prior rounds: fix Issue 1 by not fabricating an offset on parse failure (fail loudly instead, matching how the DB2 path throws on a reflection failure), fix Issue 2 by stripping precision before the Teradata/Vertica `switch` the same way `PrestoTypeMapper` now does, add value-path test coverage for at least Vertica, then rebase onto current `dev` before requesting merge.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support remaining JDBC TIMESTAMP_TZ types [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11485:
URL: https://github.com/apache/seatunnel/pull/11485#issuecomment-5343030256

   Thanks for working on this! I re-derived this review from scratch against the current head (`9f534f6800ad6f1a476452e56511bb167726734b`), reading the real diff and tracing the type-mapping call chain rather than relying on the PR description or prior review notes.
   
   # What Problem Does This PR Solve?
   - **User pain point**: Several JDBC dialects (DB2, Presto, Teradata, Vertica) and the generic/deprecated catalog fallback (`JdbcColumnConverter`) either threw `UnsupportedOperationException` / `CommonError.convertToSeaTunnelTypeError`, or silently dropped the UTC offset by folding into `LOCAL_DATE_TIME_TYPE`, whenever a source table had a `TIMESTAMP WITH TIME ZONE` / `TIMESTAMPTZ` column. This PR is the tail end of the `TIMESTAMP_TZ` migration started by PR #10048 (Postgres) and the broader effort recorded in `incompatible-changes.md`.
   - **Fix approach**: Add a `TIMESTAMP_WITH_TIMEZONE → OFFSET_DATE_TIME_TYPE` case to `GenericTypeConverter` and `DB2TypeConverter`; add native-type-name recognition to `PrestoTypeMapper`, `TeradataTypeMapper`, `VerticaTypeMapper`; teach the generic `JdbcColumnConverter` fallback to reclassify a column as `TIMESTAMP_WITH_TIMEZONE` from its native type name even when the driver's own `DATA_TYPE` code doesn't say so; and add a DB2-for-z/OS-specific value reader (`DBTimestamp.toDBString(true)` via reflection) because `ResultSet.getString()` strips the offset for that driver's proprietary type.
   - **One-sentence summary**: Closes out `TIMESTAMP_TZ` support for the remaining JDBC dialects, but the two dialects with the least mature JDBC drivers (Teradata, Vertica) get weaker guarantees than Presto/DB2 got in this same PR, and the branch itself is currently unmergeable against `dev`.
   
   # 1. Code Change Review
   
   ## 1.1 Core Logic Analysis
   
   **Files touched (production code)**: `JdbcColumnConverter.java`, `GenericTypeConverter.java`, `DB2TypeConverter.java`, `PrestoDialect.java`, `PrestoTypeMapper.java`, `TeradataTypeMapper.java`, `VerticaTypeMapper.java`, `JdbcFieldTypeUtils.java`.
   
   The critical path is schema discovery (`*TypeMapper.mapping(...)` / `*TypeConverter.convert(...)`, invoked once per column at catalog/schema-inference time) feeding into per-row value reads (`AbstractJdbcRowConverter.toInternal()` → `case TIMESTAMP_TZ: JdbcFieldTypeUtils.getOffsetDateTime(rs, idx)`, unchanged in this PR, at `AbstractJdbcRowConverter.java:121-125`). If schema discovery gets the type wrong, either the column is unreadable (fails fast) or the value reader mis-parses it (silently wrong).
   
   **Before/after — `JdbcColumnConverter.java` (the deprecated generic catalog fallback, still live — see below):**
   ```java
   // before
   switch (jdbcType) {
       ...
       case TIMESTAMP:
       case TIMESTAMP_WITH_TIMEZONE:
           seaTunnelType = LocalTimeType.LOCAL_DATE_TIME_TYPE;
           break;
   
   // after
   int effectiveJdbcType =
           isTimestampWithTimeZone(nativeType) ? TIMESTAMP_WITH_TIMEZONE : jdbcType;
   switch (effectiveJdbcType) {
       ...
       case TIMESTAMP:
           seaTunnelType = LocalTimeType.LOCAL_DATE_TIME_TYPE;
           break;
       case TIMESTAMP_WITH_TIMEZONE:
           seaTunnelType = LocalTimeType.OFFSET_DATE_TIME_TYPE;
           break;
   ```
   `isTimestampWithTimeZone` matches `"TIMESTAMPTZ"` exactly or `TIMESTAMP(?:\s*\(\s*\d+\s*\))?\s+WITH\s+TIME\s+ZONE` against the upper-cased native type name (`JdbcColumnConverter.java:265-272`).
   
   **Before/after — `GenericTypeConverter.java`:**
   ```java
   // before: no case for Types.TIMESTAMP_WITH_TIMEZONE at all → fell into `default:` →
   // log.warn(...) and the builder's dataType is left unset.
   // after:
   case Types.TIMESTAMP_WITH_TIMEZONE:
       builder.dataType(LocalTimeType.OFFSET_DATE_TIME_TYPE);
       builder.scale(typeDefine.getScale());
       break;
   ```
   
   **`PrestoTypeMapper.java` — the interesting fix in this PR:**
   ```java
   String columnType = metadata.getColumnTypeName(colIndex).toUpperCase();
   // Presto can report a precision between TIMESTAMP and WITH TIME ZONE.
   if (columnType.startsWith(PRESTO_TIMESTAMP) && columnType.contains("WITH TIME ZONE")) {
       columnType = PRESTO_TIMESTAMP_WITH_TIME_ZONE;
   }
   // VARCHAR(x)      --->      VARCHAR
   if (columnType.indexOf("(") > -1) {
       columnType = columnType.split("\\(")[0];
   }
   ```
   This is correct and necessary: Presto/Trino reports `timestamp(3) with time zone`, and the pre-existing generic `split("\\(")[0]` strip (needed for `VARCHAR(255)` etc.) would otherwise truncate that string to bare `"TIMESTAMP"`, losing the `WITH TIME ZONE` suffix and silently dropping the column into the timezone-naive branch. The normalization runs *before* the generic paren-strip, so precision-qualified input is handled correctly. Verified against `TimestampWithTimeZoneTypeMappingTest.testPrestoTimestampWithTimeZone`.
   
   **`TeradataTypeMapper.java` / `VerticaTypeMapper.java` — the same class of fix is NOT applied here:**
   ```java
   // TeradataTypeMapper.mapping(), no precision normalization at all:
   String teradataType = metadata.getColumnTypeName(colIndex).toUpperCase();
   switch (teradataType) {
       ...
       case TERADATA_TIMESTAMP_WITH_TIME_ZONE:   // exact-equals "TIMESTAMP WITH TIME ZONE"
           return LocalTimeType.OFFSET_DATE_TIME_TYPE;
       default:
           throw CommonError.convertToSeaTunnelTypeError(...);
   }
   ```
   See Issue 1 below — this is an exact `switch`/`equals` match with no tolerance for a precision-qualified type name, unlike the Presto fix two files away in the same commit.
   
   **`DB2TypeConverter.java`** adds a matching `case` and reconstructs `sourceType` as `"TIMESTAMP(%d) WITH TIME ZONE"`; correct and consistent with how the rest of the class already models scale.
   
   **`JdbcFieldTypeUtils.java`** adds a `DBTimestamp`-specific branch (checked by exact class name, ahead of the generic `Timestamp` branch since `DBTimestamp extends Timestamp`) that calls `toDBString(true)` via reflection to recover the offset that `ResultSet.getString()` would otherwise strip for this driver, plus a `normalizeDb2OffsetDateTimeString` step that truncates DB2's up-to-12-digit fractional seconds to the 9 digits `java.time` supports — by truncation, not rounding, so the represented instant is never advanced. This part is well-reasoned and has a dedicated unit test (`JdbcFieldTypeUtilsTest.testGetOffsetDateTimeFromDb2TimestampPreservesOffsetAndTruncatesPicos`) that mocks a real `DBTimestamp` and asserts `getString()` is never called — good, precise test.
   
   **Key Findings:**
   - The normal read path (source query execution → `AbstractJdbcRowConverter` → `JdbcFieldTypeUtils.getOffsetDateTime`) is squarely hit by this change; this is not a defensive/edge-case fix, it's the main path for any table with a `TIMESTAMP WITH TIME ZONE` column in the four newly-covered dialects.
   - Db2 and Presto get precision/format-tolerant matching plus dedicated value-round-trip tests. Teradata and Vertica get exact-string type-name matching and zero value-round-trip tests — the two weakest drivers get the least defensive implementation.
   - The fix is precise (not a workaround) for DB2, Presto, and the generic `GenericTypeConverter`/`JdbcColumnConverter` cases; for Teradata/Vertica it's a partial fix that reproduces the same "precision embedded in `getColumnTypeName()`" hazard the PR explicitly solved for Presto two files over.
   - Remaining hole: `JdbcFieldTypeUtils.getOffsetDateTime()`'s pre-existing generic `Timestamp` fallback (not touched by this PR, but newly reachable for Teradata/Vertica since before this PR those dialects could never produce a `TIMESTAMP_TZ`-typed column at all) silently falls back to `Timestamp.toInstant().atOffset(ZoneOffset.UTC)` — i.e., mislabels a JVM-default-timezone-shifted instant as UTC — if `parseOffsetDateTimeFromString` throws on whatever string `resultSet.getString()` returns for that driver. See Issue 3.
   
   **Runtime path (source-side schema inference → value read, cross-stage because the inferred `SeaTunnelDataType` flows into every downstream Transform/Sink):**
   ```text
   Job starts, JDBC source schema discovery
     -> CatalogUtils.getTableSchema(metadata, tablePath, dialect)  [CatalogUtils.java:230-238]
         -> dialect.getJdbcDialectTypeMapper().mappingColumn(metadata, ...)
             -> for Teradata/Vertica/Presto: mappingColumn(BasicTypeDefine) not overridden
                -> throws UnsupportedOperationException
         -> catch (UnsupportedOperationException e): columns = JdbcColumnConverter.convert(metadata, tablePath)  [CatalogUtils.java:256-257]
             -> isTimestampWithTimeZone(nativeType) reclassifies effectiveJdbcType
             -> TIMESTAMP_WITH_TIMEZONE branch now yields OFFSET_DATE_TIME_TYPE (was LOCAL_DATE_TIME_TYPE)
     (this is table_path= mode; query= mode instead goes through
      CatalogUtils.getCatalogTable(ResultSetMetaData, typeMapper, sqlQuery) -> typeMapper.mapping(metadata, index)
      directly, i.e. TeradataTypeMapper/VerticaTypeMapper/PrestoTypeMapper's own exact-match switch — a
      DIFFERENT code path from the tolerant regex above, see Issue 1)
   Row read phase
     -> AbstractJdbcRowConverter.toInternal(), case TIMESTAMP_TZ  [AbstractJdbcRowConverter.java:121-125]
         -> JdbcFieldTypeUtils.getOffsetDateTime(rs, idx)
             -> DB2: DBTimestamp branch, toDBString(true) via reflection, offset preserved
             -> everyone else backed by java.sql.Timestamp: re-read as string, parseOffsetDateTimeFromString
                -> on parse failure: silently returns Timestamp.toInstant().atOffset(UTC) [JdbcFieldTypeUtils.java:210]
   ```
   
   ## 1.2 Compatibility Impact: **Partially incompatible**
   - This PR is an incremental extension of an already-documented breaking change (`docs/en/introduction/concepts/incompatible-changes.md`, "Breaking Change: Mapping of timezone-aware timestamp columns to `TIMESTAMP_TZ` type", tracked under `#10685`). That entry already frames the general risk (downstream sinks expecting `TIMESTAMP` may now get `TIMESTAMP_TZ`).
   - What's new and *not* covered by that entry or by this PR's own doc updates: the `JdbcColumnConverter` fallback change is not scoped to DB2/Presto/Teradata/Vertica — it changes behavior for **any** dialect that (a) has no `mappingColumn(BasicTypeDefine)` override and (b) is read in `table_path=` mode, whenever the driver reports a native type name matching the new regex or `TIMESTAMPTZ`, or a `DATA_TYPE` code of `Types.TIMESTAMP_WITH_TIMEZONE`. Before this PR such a column deterministically mapped to `LOCAL_DATE_TIME_TYPE`; after this PR it maps to `OFFSET_DATE_TIME_TYPE`. For any already-running job on an unlisted/custom dialect that happens to match, this silently changes the inferred schema (and, per the existing ledger entry, can change how Iceberg/Hudi/StarRocks sinks serialize the column) — with no corresponding bullet added to `incompatible-changes.md` for this specific fallback path. See Issue 4.
   - No config option names, defaults, or SPI method signatures were removed or renamed. `PrestoDialect.supportsPrimaryKeyMetadata()` overriding the `true` default to `false` is additive from an API-contract point of view (the interface method already existed with a default), but changes Presto's own `table_path=` primary-key-detection behavior — see Issue 6 on scope.
   
   ## 1.3 Performance / Side-Effect Analysis
   - `JdbcFieldTypeUtils.getOffsetDateTime()` resolves `obj.getClass().getMethod("toDBString", boolean.class)` via reflection **on every row**, for every DB2 `TIMESTAMP WITH TIME ZONE` column (`JdbcFieldTypeUtils.java:189`), instead of caching the `Method` once. Reflective `getMethod` lookups are not free; for a wide DB2 z/OS extract with multiple TZ columns and millions of rows this is avoidable per-row overhead. See Issue 5 (Low, not a correctness bug).
   - The new `Pattern` in `JdbcColumnConverter` is a `static final` field, compiled once — correct.
   - No new locks, no new network calls, no unbounded buffers introduced.
   
   ## 1.4 Error Handling and Logging
   - The DB2 reflection branch correctly wraps `ReflectiveOperationException | ClassCastException` into a `SQLException` with context (`"Failed to read Db2 timestamp with time zone"`), rather than swallowing it — good.
   - `JdbcColumnConverter`'s `default:` branch now reports `effectiveJdbcType` in the exception message instead of the raw `jdbcType` — a good, deliberate improvement (the error now reflects the type actually being switched on).
   - No sensitive data is logged; no exceptions are swallowed by this PR's own changes.
   - See Issue 3 for the *pre-existing* silent-fallback risk this PR newly exposes for Teradata/Vertica (not introduced by this PR, but newly reachable and untested for these two dialects).
   
   **Issue 1: Teradata/Vertica precision-qualified `TIMESTAMP(n) WITH TIME ZONE` is unrecognized in `query=` mode**
   - **Location:** `seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/teradata/TeradataTypeMapper.java:66-101`, `.../vertica/VerticaTypeMapper.java:100-180`
   - **Problem description:** Both mappers do an exact `switch`/`equals` comparison against `"TIMESTAMP WITH TIME ZONE"` on the upper-cased `ResultSetMetaData.getColumnTypeName()` value, with no precision-paren tolerance. `PrestoTypeMapper`, touched in this same commit, explicitly guards against exactly this hazard (`columnType.startsWith(PRESTO_TIMESTAMP) && columnType.contains("WITH TIME ZONE")`, applied before the generic paren-strip) because Presto reports `timestamp(3) with time zone`. This mapper is used exclusively by `query =` mode source configs (`CatalogUtils.getCatalogTable(ResultSetMetaData, typeMapper, sqlQuery)` → `typeMapper.mappingColumn(metadata, index)` default impl → `mapping(metadata, colIndex)` directly), which is a different code path from the tolerant `JdbcColumnConverter` regex fallback used by `table_path=` mode.
   - **Potential risk:** If the Teradata/Vertica JDBC driver ever embeds precision in `getColumnTypeName()` for this type (plausible — this PR's own `JdbcColumnConverter`-fallback test, `testTableMetadataFallbackRecognizesProprietaryTypeCodes`, uses `"TIMESTAMP(6) WITH TIME ZONE"` as the illustrative "teradata" input, and `DB2TypeConverter` in this same PR constructs source types in the `"TIMESTAMP(%d) WITH TIME ZONE"` shape), any `query=`-mode job hits `default:` and throws `CommonError.convertToSeaTunnelTypeError` at schema-discovery time — the column becomes entirely unreadable via `query=` mode, which is the primary mode exercised by this PR's own tests (the Presto e2e test uses `query=`, not `table_path=`).
   - **Best improvement:** Apply the same normalization used for Presto (strip/normalize an optional `(n)` before the switch) to `TeradataTypeMapper` and `VerticaTypeMapper`, or reuse the `TIMESTAMP_WITH_TIME_ZONE_TYPE_NAME` regex already added to `JdbcColumnConverter` so all three dialects share one tolerant matcher instead of three different heuristics.
   - **Severity:** Medium (not confirmed with a live Teradata/Vertica driver — static analysis only, per review scope — but internally inconsistent with the PR's own fix pattern and its own test fixtures).
   
   **Issue 2: Merge conflict — PR is not currently mergeable against `dev`**
   - **Location:** GitHub mergeability state (`mergeStateStatus=DIRTY`, `mergeable=CONFLICTING`); `compare/dev...9f534f680` reports `status=diverged, ahead_by=5, behind_by=45`.
   - **Problem description:** I ran a live check (not cached): `dev`'s `seatunnel-e2e/.../JdbcPrestoIT.java` now imports `org.apache.seatunnel.e2e.common.util.DependencyJar` and calls `DependencyJar.ofClassName(DRIVER_CLASS)` instead of the `driverUrl()` override this branch's `JdbcPrestoIT.java` still relies on — confirmed by reading `dev`'s copy of the file directly. This is an unrelated upstream E2E-infrastructure refactor that happens to touch the exact file this PR extends with `testTimestampWithTimeZoneMappingAndValue()`.
   - **Potential risk:** Cannot be merged as-is regardless of code correctness; GitHub will block the merge button and a stale rebase risks silently reintroducing the old `driverUrl()` pattern dev has since moved away from.
   - **Best improvement:** Sync with the latest `dev`, drop the removed `driverUrl()` override, keep the new `testTimestampWithTimeZoneMappingAndValue()` method and its imports, adopt `DependencyJar`-based resolution, then re-run CI to confirm the Presto E2E cases (including the new TZ test) still pass under the new driver-resolution mechanism.
   - **Severity:** High (blocks merge outright; independent of all code-quality findings above).
   
   **Issue 3: Shared `Timestamp`-string fallback can silently mislabel a JVM-shifted instant as UTC, now newly reachable — and untested — for Teradata/Vertica**
   - **Location:** `seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/utils/JdbcFieldTypeUtils.java:201-212` (pre-existing code, not touched by this PR)
   - **Problem description:**
     ```java
     if (obj instanceof Timestamp) {
         String strVal = resultSet.getString(columnIndex);
         if (strVal == null) return null;
         try {
             return parseOffsetDateTimeFromString(strVal);
         } catch (Exception e) {
             // Last resort: use the instant-based conversion (may shift by JVM offset)
             return ((Timestamp) obj).toInstant().atOffset(ZoneOffset.UTC);
         }
     }
     ```
     Before this PR, Teradata and Vertica could never produce a `TIMESTAMP_TZ`-typed column (both mappers threw `CommonError.convertToSeaTunnelTypeError` for `TIMESTAMP WITH TIME ZONE`), so this fallback was never exercised for them. This PR makes it the value-read path for both dialects, but adds no dedicated test that feeds a realistic Teradata/Vertica driver `getString()` output through `parseOffsetDateTimeFromString` to prove it actually succeeds — contrast with DB2, which got a dedicated `DBTimestamp`-mocking test in this same PR.
     I verified the two most likely real-world formats (Vertica Postgres-style `"...-04"` and Teradata `"...+08:00"`) do parse correctly via the existing `normalizeOffsetDateTimeString`/direct-ISO paths, so I cannot confirm this branch is actually hit in practice — but the absence of any test proving it, for a `catch (Exception e)` block whose failure mode is silent data corruption rather than a thrown error, is itself the gap.
   - **Potential risk:** If a Teradata/Vertica driver ever returns a `getString()` format this parser doesn't recognize, the job does not fail — it silently returns a wrong `OffsetDateTime` (JVM-local instant mislabeled as UTC) with no log line distinguishing this from a genuine UTC value.
   - **Best improvement:** Add a `log.warn` (or at minimum a code comment) at the fallback site noting which dialect/format triggered it, and add a `JdbcFieldTypeUtilsTest` case per newly-supported dialect (Teradata, Vertica) that exercises `getOffsetDateTime` with a `Timestamp` + a realistic driver-formatted string, mirroring the DB2 test already present.
   - **Severity:** Medium.
   
   **Issue 4: `incompatible-changes.md` not extended for this PR's newly-covered dialects**
   - **Location:** `docs/en/introduction/concepts/incompatible-changes.md:10-23` (existing entry, not touched by this PR)
   - **Problem description:** The existing "Breaking Change: Mapping of timezone-aware timestamp columns to `TIMESTAMP_TZ` type" entry has a dedicated "Connector-specific behavior changes" bullet list for every dialect a prior PR touched (Snowflake, StarRocks, Hudi, Xugu, CDC/TiDB, Iceberg). This PR follows the same underlying breaking-change pattern for DB2, Presto, Teradata, and Vertica, plus the generic `JdbcColumnConverter` fallback (which is broader than these four — see 1.2), but adds no bullets to this ledger, and doesn't touch this file at all.
   - **Potential risk:** A user auditing `incompatible-changes.md` before upgrading (which is the documented, expected workflow — "You need to check this document before you upgrade to related version") will not learn that their DB2/Presto/Teradata/Vertica `TIMESTAMP WITH TIME ZONE` columns, or any custom-dialect column reached via the `JdbcColumnConverter` fallback, now infer as `TIMESTAMP_TZ` instead of `TIMESTAMP`/failing outright.
   - **Best improvement:** Add bullets for DB2, Presto, Teradata, Vertica following the existing format, and explicitly call out the `JdbcColumnConverter` generic-fallback behavior change since it's not scoped to a named dialect.
   - **Severity:** Medium.
   
   **Issue 5: DB2 `toDBString` reflection re-resolved every row instead of cached**
   - **Location:** `seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/utils/JdbcFieldTypeUtils.java:189`
   - **Problem description:** `Method toDBString = obj.getClass().getMethod("toDBString", boolean.class);` runs inside `getOffsetDateTime()`, called once per row per `TIMESTAMP_TZ` column via `AbstractJdbcRowConverter`.
   - **Potential risk:** Unnecessary reflective lookup overhead in the row-conversion hot path for high-volume DB2-for-z/OS batch extracts with TZ columns. Not a correctness issue.
   - **Best improvement:** Resolve the `Method` once (e.g., a lazily-initialized static field guarded by the class-name check) and reuse it across rows.
   - **Severity:** Low.
   
   **Issue 6: `PrestoDialect.supportsPrimaryKeyMetadata()` is unrelated to this PR's stated scope**
   - **Location:** `seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/presto/PrestoDialect.java:43-46`
   - **Problem description:** This flips the default `true` to `false`, meaning `CatalogUtils.getTableSchema(metadata, tablePath, dialect)` skips `DatabaseMetaData.getPrimaryKeys()` for Presto in `table_path=` mode. It's a real, independently-tested fix (`TimestampWithTimeZoneTypeMappingTest.testPrestoSkipsUnsupportedPrimaryKeyMetadata`) for a genuine gap — `CatalogUtils.getPrimaryKey` propagates any `SQLException` from an unsupported `getPrimaryKeys()` call uncaught — but it is not exercised by the PR's own e2e test (which uses `query=` mode, so this code path is untouched by any test with a live Presto container) and is unrelated to `TIMESTAMP_TZ` support.
   - **Potential risk:** Low risk of harm (turning the flag off only skips a call that would otherwise likely throw), but it's scope creep that makes the PR harder to review/bisect and isn't explained in the PR description.
   - **Best improvement:** Either split this into its own PR/commit with its own rationale, or add a sentence to the PR description explaining why it's bundled here.
   - **Severity:** Low.
   
   **Issue 7: Undocumented removal of `setAutoCommit(false)` in shared e2e test setup**
   - **Location:** `seatunnel-e2e/.../connector-jdbc-e2e-part-7/src/test/java/org/apache/seatunnel/connectors/seatunnel/jdbc/JdbcPrestoIT.java` (`initializeJdbcConnection`)
   - **Problem description:** `this.connection.setAutoCommit(false);` was removed with no comment. This affects every test method in the class (shared connection setup), not just the new TZ test, and there's no explanation of why the explicit transaction mode was dropped.
   - **Potential risk:** Low as-is (Presto's `memory` connector likely doesn't support explicit transactions well, so removing this is plausibly a correctness fix), but an unexplained behavior change to shared test infrastructure is a maintainability trap for the next person touching this file.
   - **Best improvement:** Add a one-line comment explaining why autocommit is now left at its default.
   - **Severity:** Low.
   
   # 2. Code Quality Assessment
   
   ## 2.1 Coding Standards
   - All new non-trivial fields/constants have explanatory comments (`DB2_TIMESTAMP_CLASS_NAME`, `DB2_TIMESTAMP_WITH_TIME_ZONE_PATTERN`, `TIMESTAMP_WITH_TIME_ZONE_TYPE_NAME`, the Presto/Teradata/Vertica constants) — good adherence to the "why, not what" standard.
   - `isTimestampWithTimeZone` and `normalizeDb2OffsetDateTimeString` are new non-trivial private methods without their own doc comments (single-line `//` comments exist at call sites but not on the methods themselves) — minor, non-blocking per the "boilerplate exempt" carve-out, but these aren't boilerplate; a short Javadoc on each would meet the bar more cleanly. Not raised as a numbered issue since the call-site comments already convey intent adequately.
   - Test file `TimestampWithTimeZoneTypeMappingTest.java` uses plain `/* ... */` block comments (not Javadoc `/** */`) at class and method level — acceptable, not the prohibited single-line-`/** */` style.
   
   ## 2.2 Test Coverage and Test Stability
   - **DB2**: full coverage — type-mapping test (`Db2TypeConverterTest.testConvertTimestampWithTimeZone`) and value-round-trip test with a mocked real `DBTimestamp` (`JdbcFieldTypeUtilsTest`) that specifically asserts `getString()` is never invoked, proving the reflection path is actually taken. Strong.
   - **Presto**: type-mapping unit test + a genuine e2e test against a live Testcontainers Presto instance (`JdbcPrestoIT.testTimestampWithTimeZoneMappingAndValue`), asserting both the mapped type and the parsed value against a known-good literal. Strong.
   - **Teradata / Vertica**: only type-mapping unit tests using the bare (non-precision-qualified) `"TIMESTAMP WITH TIME ZONE"` / `"TIMESTAMPTZ"` strings — no e2e test (no Teradata/Vertica Testcontainers image is realistic to run in this repo's CI, understandably), and no `JdbcFieldTypeUtilsTest` value-round-trip test at all. Combined with Issue 1 and Issue 3, this means the two weakest-covered dialects are also the two with the least tolerant implementation.
   - No `Thread.sleep`, no unclosed resources, no order-dependent assertions, no floating-point-without-delta, and no non-deterministic assertions found in any of the added/modified tests. The e2e readiness signal (`given().ignoreExceptions().await()...untilAsserted(...)` polling a `CREATE TABLE IF NOT EXISTS _readiness_probe`) is pre-existing and unchanged.
   - **Rating: Risk present** — not because any added test is flaky, but because a real Teradata/Vertica regression in Issue 1 or Issue 3 would not be caught by this PR's own CI suite (path: `TeradataTypeMapper.java:95-96`, `VerticaTypeMapper.java:161-163`, no corresponding e2e or value-level unit test).
   
   ## 2.3 Documentation Updates
   - `docs/en/connectors/source/Jdbc.md` and the `zh` equivalent gained a clear "Timestamp with time zone" section listing exactly which native types map to `TIMESTAMP_TZ`, matching the code (Presto `timestamp(p) with time zone` — matches the precision-tolerant Presto fix; Teradata is listed without a `(p)` qualifier, consistent with `TeradataTypeMapper`'s exact-match implementation, so the doc is at least internally honest about the current code's limitation even though it doesn't call it out as a limitation).
   - `docs/en/connectors/sink/Jdbc.md` / `zh` correctly disclose that DB2 auto-table-creation isn't supported for this type, consistent with `DB2TypeConverter.reconvert()` having no `OFFSET_DATE_TIME_TYPE` case.
   - Not updated: `incompatible-changes.md` — see Issue 4.
   
   # 3. Architectural Soundness
   
   ## 3.1 Elegance
   Mixed: DB2 and Presto are **Precise fixes** (root-caused to the actual driver quirk, with matching tests). Teradata/Vertica are **partial fixes** — they add the SeaTunnel-side type mapping but don't close the same driver-format-variance gap the PR closes for Presto in the identical commit, so they land closer to a **temporary workaround** for the common case than a fully robust fix.
   
   ## 3.2 Maintainability
   Reasonable — each dialect's type name constants and matching logic stay localized to its own `TypeMapper`/`TypeConverter` class, consistent with the existing per-dialect architecture (no leakage of dialect-specific logic into the engine or shared core, in line with this repo's connector guidelines). The one exception is `JdbcColumnConverter`'s new `isTimestampWithTimeZone` regex, which duplicates (with a superset pattern) the same "precision may be embedded" concept that `PrestoTypeMapper` now also implements independently and `TeradataTypeMapper`/`VerticaTypeMapper` don't implement at all — three different answers to the same problem in one PR is a maintainability smell worth converging (see Issue 1's suggested fix).
   
   ## 3.3 Extensibility
   Good — the pattern (add a `TIMESTAMP_WITH_TIME_ZONE` constant + switch case per dialect) is easy for the next contributor to replicate for any remaining dialect not yet covered.
   
   ## 3.4 Historical-Version Compatibility
   Already-running jobs that read a `TIMESTAMP WITH TIME ZONE`/`TIMESTAMPTZ` column through DB2, Presto (bare form), Teradata (bare form), or the `GenericTypeConverter` path were previously either broken (threw `UnsupportedOperationException`/`CommonError`) or, for the `JdbcColumnConverter` fallback specifically, silently returning `LocalDateTime` — see 1.2 for the full compatibility classification and Issue 4 for the documentation gap this leaves.
   
   # 4. Issue Summary
   
   | Number | Issue | Location | Severity |
   |---|---|---|---|
   | 2 | PR is not mergeable against `dev` (real content conflict in `JdbcPrestoIT.java`, caused by unrelated upstream E2E-infra refactor) | GitHub mergeability state / `JdbcPrestoIT.java` | High |
   | 1 | Teradata/Vertica `query=`-mode type matching doesn't tolerate precision-qualified `TIMESTAMP(n) WITH TIME ZONE`, unlike the Presto fix in the same PR | `TeradataTypeMapper.java:66-101`, `VerticaTypeMapper.java:100-180` | Medium |
   | 3 | Pre-existing silent UTC-mislabeling fallback newly reachable, and untested, for Teradata/Vertica | `JdbcFieldTypeUtils.java:201-212` | Medium |
   | 4 | `incompatible-changes.md` not extended for this PR's dialects / the generic fallback change | `docs/en/introduction/concepts/incompatible-changes.md` | Medium |
   | 5 | DB2 reflection `Method` lookup re-done every row instead of cached | `JdbcFieldTypeUtils.java:189` | Low |
   | 6 | `PrestoDialect.supportsPrimaryKeyMetadata()` is scope creep relative to the PR's stated purpose | `PrestoDialect.java:43-46` | Low |
   | 7 | Undocumented removal of `setAutoCommit(false)` in shared e2e test setup | `JdbcPrestoIT.java` (`initializeJdbcConnection`) | Low |
   
   # 5. Merge Recommendation
   
   ### Conclusion: Ready to merge after fixes
   
   1. **Blockers** (must be fixed):
      - Issue 2 (High) — sync with `dev` and resolve the `JdbcPrestoIT.java` conflict; this alone prevents merging today regardless of everything else.
      - Issue 1 (Medium) — either confirm (with real Teradata/Vertica driver testing, which I could not do here per this review's static-analysis-only scope) that the exact-match type name is actually correct for both drivers, or add the same precision-tolerant normalization Presto got in this PR.
      - Issue 3 (Medium) — at minimum, add value-round-trip tests for Teradata/Vertica proving the shared string-parsing fallback handles their actual `getString()` output; ideally also add a log line at the silent-fallback site.
   
   2. **Recommended fixes** (non-blocking):
      - Issue 4 — extend `incompatible-changes.md` to match the existing per-dialect bullet pattern.
      - Issue 5 — cache the DB2 reflection `Method` lookup.
      - Issue 6 — explain or split out the `PrestoDialect.supportsPrimaryKeyMetadata()` change.
      - Issue 7 — comment the `setAutoCommit` removal.
   
   **Overall assessment**: The core idea and the DB2/Presto/GenericTypeConverter implementations are solid, precisely scoped, and well-tested — the DB2 reflection-based offset recovery in particular is a careful piece of work with a test that proves the right code path is taken. The gap is consistency: the PR fixes a specific "precision embedded in the type name" driver quirk for Presto but leaves the identical class of quirk unaddressed for Teradata and Vertica, and doesn't add the value-level test coverage for those two dialects that would either prove it's a non-issue or catch the regression. Given this is genuinely difficult to fully validate without live Teradata/Vertica instances, **Option A** (land this PR as-is after fixing the merge conflict, and file a fast follow-up specifically for Teradata/Vertica precision-tolerance + value-round-trip tests) is a reasonable alternative to **Option B** (hold the whole PR until Teradata/Vertica reach parity with DB2/Presto) — but Opti
 on B is what I'd request before merge, since the inconsistency is demonstrable from the PR's own diff and test fixtures without needing a live driver, and the fix (reusing the existing `TIMESTAMP_WITH_TIME_ZONE_TYPE_NAME` regex or the Presto normalization pattern) is small.
   
   ---
   This is a technical self-review of my own PR (author = DanielLeens), posted as a plain issue comment rather than a GitHub Review because GitHub rejects review submissions on one's own PR (422). It does not satisfy the repository's human-approval gate; a write-capable maintainer still needs to complete that step. CI is currently green (`Build`, `Notify test workflow`, `labeler` all `pass` as of this check), so the only hard blocker right now is the `dev` merge conflict (Issue 2).
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support remaining JDBC TIMESTAMP_TZ types [seatunnel]

Posted by "DanielLeens (via GitHub) via commits" <co...@seatunnel.apache.org>.
DanielLeens commented on PR #11485:
URL: https://github.com/apache/seatunnel/pull/11485#issuecomment-6557790057

   The CI fact in my [existing full review of this exact head](https://github.com/apache/seatunnel/pull/11485#pullrequestreview-5721322127) has changed. That source review is already published; this is a gate clarification, not another full source review on the same version.
   
   Source status: the existing EN/ZH schema-migration/dialect-fallback guidance and core helper comments remain open. CI progress does not clear those source requests.
   
   The [exact-head fork Build](https://github.com/DanielLeens/seatunnel/actions/runs/41164811654) is now `in_progress` / `pending`, attempt 1. Job conclusions: success=30, cancelled=1, pending=16, skipped=31. The run is active, so do not start an overlapping rerun. Its Check Helm Chart job is cancelled while selected integration lanes are still pending/running; that is not a completed green result. Keep the remaining source/documentation requests and draft boundary visible.
   
   The current base comparison is recorded separately. Missing Apache check adoption is distinct from the fork conclusion, and neither is an effective independent approval. Daniel is the author and has READ repository permission.
   
   Checked 2026-11-01T12:14:14.650701+00:00; unchanged head `20808462f06d53a777deefadf93bbad5f7f71a32`, base `dev`; compare `diverged`, ahead 10 / behind 9; merge `blocked` / `BLOCKED`; review decision `REVIEW_REQUIRED`. Behind/diverged is recorded independently and does not itself request a sync. Daniel has READ repository permission.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support remaining JDBC TIMESTAMP_TZ types [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11485:
URL: https://github.com/apache/seatunnel/pull/11485#issuecomment-5340759230

   Tenth-round self-check, performed against the current head `9f534f6800ad6f1a476452e56511bb167726734b`. I confirmed this is byte-for-byte the same head my previous (ninth) round reviewed on 2026-08-16 — same 17 files, same `+315/-4` diff stat against the merge base, no new commit and no new discussion activity since then. Per this repository's rule that a given code version gets exactly one complete review, I am not re-deriving or re-publishing the full issue list against an unchanged version; that review still stands as the current technical conclusion for this diff, and both of its blockers remain open and unaddressed:
   
   - **Issue 1 (High)** — Teradata/Vertica `TIMESTAMP_TZ` values flow exclusively through a fallback that silently fabricates a `+00:00` offset on parse failure, with zero value-path coverage (and zero *possible* coverage for Teradata in this repo's CI).
   - **Issue 2 (Medium)** — the Teradata/Vertica `query =` discovery path cannot match `TIMESTAMP(n) WITH TIME ZONE`, which this PR's own test fixture treats as a realistic driver response.
   
   What I did re-verify live this round, rather than trust the prior snapshot:
   
   **CI.** Unchanged and still fully green. `Build`, `Notify test workflow` and `labeler` are all `completed/success` on this exact SHA, with `Build` showing the same completion timestamp (`2026-08-13T21:02:21Z`) as last round. CI is not a blocker.
   
   **Merge state — this is new information not covered in any of the previous nine rounds.** GitHub currently reports `mergeable_state=dirty` (a real content conflict), and a `compare` against `dev` shows `status=diverged`, `ahead_by=5`, `behind_by=41`. I ran a local dry-run merge against the latest `apache/dev` to find the exact cause rather than guessing: the only real conflict is in `JdbcPrestoIT.java` — the same file this PR extends with `testTimestampWithTimeZoneMappingAndValue()`. The root cause is upstream PR #11572 ("[Improve][E2E] Resolve container dependencies through Maven"), which landed on `dev` after this branch's last sync and refactored every JDBC E2E class's driver-jar resolution from an overridden `driverUrl()` method to a `DependencyJar.ofClassName(...)` call — including `JdbcPrestoIT.java`. So this is unrelated upstream E2E-infrastructure drift touching the same file by coincidence, not a semantic disagreement with this PR's own `TIMESTAMP_TZ` logic; the res
 olution is mechanical (drop the removed `driverUrl()` override, keep the new test method and its imports, adopt the new `DependencyJar` import ordering).
   
   **Updated status: three blockers now, not two.**
   
   1. Issue 1 (High) — unresolved, carried over from round nine.
   2. Issue 2 (Medium) — unresolved, carried over from round nine.
   3. **New: merge conflicts with `dev` (`mergeable_state=dirty`).** Please sync with the latest `dev` and resolve the conflict in `JdbcPrestoIT.java` first. Once synced, rerun CI to confirm the `DependencyJar`-based driver resolution still passes the Presto E2E cases this PR extends.
   
   As before, this is a technical self-check on my own PR, recorded as a plain comment because GitHub does not permit self-approval. It does not satisfy the repository approval gate. Conclusion is unchanged from round nine: **not ready to merge** until Issue 1 and Issue 2 are resolved, now with the additional prerequisite of syncing `dev` and resolving the `JdbcPrestoIT.java` conflict.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support remaining JDBC TIMESTAMP_TZ types [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #11485:
URL: https://github.com/apache/seatunnel/pull/11485#issuecomment-5379364883

   Fresh-run check-in, independently re-verified against the bare mirror rather than assumed. As the author, GitHub does not permit self-approval, so this is recorded as a plain issue comment and does not satisfy the repository approval gate.
   
   **What changed since my last review (2026-08-21T14:23:37Z):** nothing on the code side. `headRefOid` is still `9f534f6800ad6f1a476452e56511bb167726734b`, no new commits, no new comments, no other reviewer has weighed in (there are zero inline review threads and every review on this PR is mine). I did not take that on faith — I diffed `dev...refs/pr-review/11485` directly against the bare mirror (17 files, 315 insertions / 4 deletions across `docs/`, `connector-jdbc` main+test sources, and `connector-jdbc-e2e-part-7`) and re-read every changed file's current content from the object store, not from memory of the prior round. My conclusion is unchanged — this is still **not ready to merge** — but I re-derived every finding against the actual current source below, and I'm also flagging one thing my last review didn't check: the PR's live mergeability.
   
   **New in this round: the PR is not mergeable.** `gh pr view` currently shows `mergeStateStatus: DIRTY`, `mergeable: CONFLICTING`, `isDraft: true`. The branch is `61` commits behind `dev` (`ahead_by=5, behind_by=61`, `diverged`). None of my prior reviews checked this — I'd only verified CI, which is green but is a fork-side pointer against a stale base. This needs a rebase onto current `dev` before it can even be test-merged, independent of the two open code issues below.
   
   # What Problem Does This PR Solve?
   - **User pain point:** before this PR, `TIMESTAMP_TZ`-typed JDBC columns either failed discovery outright (Teradata, Vertica, Db2 for z/OS — no mapping case, `CommonError.convertToSeaTunnelTypeError`), produced a column with an unhandled JDBC 4.2 `Types.TIMESTAMP_WITH_TIMEZONE` code, or were silently flattened to timezone-naive `TIMESTAMP` with the offset discarded and no error (Presto's precision-qualified type name, and the shared legacy metadata fallback used by every dialect without its own `mappingColumn(BasicTypeDefine)` implementation).
   - **Fix approach:** add the missing type-mapping cases in five places (generic JDBC 4.2 converter, Db2, Presto, Teradata, Vertica); canonicalize Presto's precision-qualified type name before the pre-existing paren-truncation step; recognize proprietary native type names (`TIMESTAMPTZ`, `TIMESTAMP(n) WITH TIME ZONE`) in the shared legacy fallback via a regex; add a Db2-specific value-read branch that recovers the offset the IBM driver's `getString()` normally strips.
   - **One-sentence summary:** the Db2, Presto, and generic-JDBC-4.2 legs of this PR are correctly and rigorously implemented and tested end-to-end, but Teradata and Vertica are given the exact same "offset preserved" contract in the docs and type mappers while their actual *value*-read path is untested and can silently fall back to a conversion the code's own comment says is unreliable — that gap is why I still can't approve this.
   
   # 1. Code Change Review
   
   ## 1.1 Core Logic Analysis
   
   Re-read from the current head, not assumed:
   
   - **Generic JDBC 4.2** (`GenericTypeConverter.java:170-173`): `Types.TIMESTAMP_WITH_TIMEZONE` now maps to `OFFSET_DATE_TIME_TYPE`. `reconvert()` in this class throws `UnsupportedOperationException` unconditionally for every type (pre-existing, unrelated to this PR) — no asymmetry introduced here.
   - **Db2 for z/OS** (`DB2TypeConverter.java:224-229`): `DB2_TIMESTAMP_WITH_TIME_ZONE = "TIMESTAMP WITH TIME ZONE"` is a new switch case in `convert()` mapping to `OFFSET_DATE_TIME_TYPE`. I checked whether the matching `reconvert()` (sink schema-creation direction) has a `TIMESTAMP_TZ` case — it does not, so a `TIMESTAMP_TZ` column written to a Db2 sink with auto-create-table enabled would hit `default:` and throw `CommonError.convertToConnectorTypeError`. This looked like a real gap until I checked the docs: `docs/en/connectors/sink/Jdbc.md` explicitly states *"Auto table creation remains available only for dialects that provide a catalog and a timezone-aware type converter; Db2 does not currently provide JDBC auto table creation."* So this is a disclosed, deliberate scope boundary, not an overlooked bug — good that it's documented rather than silently discovered by a user.
   - **Value-read path for Db2** (`JdbcFieldTypeUtils.java:186-196`): `com.ibm.db2.jcc.DBTimestamp` is detected by class name and its offset is recovered via reflection (`toDBString(true)`) rather than a direct import, even though `db2jcc` is already a `compile`-scope dependency of this module (confirmed in `connector-jdbc/pom.xml`, unchanged by this PR) and the new unit test (`JdbcFieldTypeUtilsTest.java`) imports `DBTimestamp` directly. The reflection isn't wrong — it fails loud via `SQLException` if the method signature ever changes — but it's more defensive than necessary given the direct dependency is already there and already used in the test. Low-severity, non-blocking style note.
   - **Presto** (`PrestoTypeMapper.java:69-75`): `columnType.startsWith(PRESTO_TIMESTAMP) && columnType.contains("WITH TIME ZONE")` canonicalizes `timestamp(3) with time zone` to the exact-match constant *before* the pre-existing `"(" `-index truncation runs. I checked the ordering is load-bearing: without it, `"TIMESTAMP(3) WITH TIME ZONE".split("\\(")[0]` would produce `"TIMESTAMP"`, colliding with plain `TIMESTAMP` and silently dropping the offset — exactly the bug this PR fixes. Verified end-to-end via a real Presto container in `JdbcPrestoIT.testTimestampWithTimeZoneMappingAndValue`, which pins `timeZoneId=UTC` on the JDBC URL and asserts an exact `OffsetDateTime` (not just "didn't throw").
   - **Teradata / Vertica** (`TeradataTypeMapper.java:95-96`, `VerticaTypeMapper.java:161-163`): metadata mapping is correct for the *exact-string* case (`"TIMESTAMP WITH TIME ZONE"` / `"TIMESTAMPTZ"`), but see Issues 1 and 2 below — both the value-read path and part of the discovery path have real gaps that Db2 and Presto don't.
   - **Legacy metadata fallback** (`JdbcColumnConverter.java`): `TIMESTAMP_WITH_TIMEZONE` is correctly split out of the previously-shared `TIMESTAMP` case (was: both mapped to `LOCAL_DATE_TIME_TYPE`, silently dropping the offset for any dialect using this fallback and reporting JDBC type `-101`). I also checked the new `isTimestampWithTimeZone(nativeType)` regex (`TIMESTAMP(?:\s*\(\s*\d+\s*\))?\s+WITH\s+TIME\s+ZONE`, used with `.matches()` against the fully-uppercased, trimmed native type name) against Oracle's `TIMESTAMP(n) WITH LOCAL TIME ZONE`, which is a *different* semantic type (session-relative, no explicit per-row offset) — the regex requires `WITH` immediately followed by `TIME`, so `"...WITH LOCAL TIME ZONE"` does not match and is correctly left alone. Oracle has its own dedicated `OracleTypeConverter` anyway, so this fallback wouldn't apply to it in practice, but it's good that the regex doesn't create a latent trap if a similar LTZ-style dialect string ever reaches this
  path.
   
   **Full runtime path for the still-open value-path gap** (Issue 1), traced from `AbstractJdbcRowConverter` down to the exact fallback branch, re-verified line-for-line against the current head:
   
   ```text
   AbstractJdbcRowConverter.toInternal(...)
     -> case TIMESTAMP_TZ:                                         [AbstractJdbcRowConverter.java:121-125]
         -> JdbcFieldTypeUtils.getOffsetDateTime(rs, idx)           [JdbcFieldTypeUtils.java:163-]
             -> resultSet.getObject(columnIndex)
             -> not OffsetDateTime / ZonedDateTime / Instant / DBTimestamp
             -> instanceof Timestamp branch                        [JdbcFieldTypeUtils.java:198-212]
                 -> resultSet.getString(columnIndex)                // Teradata/Vertica drivers land here
                 -> parseOffsetDateTimeFromString(strVal)
                     -- driver renders a numeric offset ("+08:00") -> parses correctly
                     -- driver renders a region-ID zone (e.g. "... Asia/Shanghai") -> parse throws
                 -> catch (Exception e):
                        return ((Timestamp) obj).toInstant().atOffset(ZoneOffset.UTC)
                     -- this is exactly the conversion the method's own comment two lines above
                        warns against: "Avoid using Timestamp.toInstant() directly because the
                        Timestamp was constructed with JVM-default-timezone semantics, which would
                        shift the value by the JVM offset" — used here as a silent last resort,
                        with no log, no exception, no error code
   ```
   
   **Key findings:**
   1. This is not a boundary/exception-only path for Teradata/Vertica — it is their *only* value-read path for `TIMESTAMP_TZ` columns, reached on every normal row read once discovery has (correctly) mapped the column to `OFFSET_DATE_TIME_TYPE`. Before this PR, such columns never reached this code at all (discovery failed loudly first, per `CommonError.convertToSeaTunnelTypeError`); this PR's own metadata fix is what routes them into a value-read path that was hardened for Db2 (reflection-based, driver-specific) and Presto (proven via real container) but not for them.
   2. `Timestamp.toInstant()` on a `java.sql.Timestamp` that a driver constructed via JVM-default-timezone semantics from a TZ-aware SQL value can represent the **wrong instant**, not merely the right instant with a mislabeled offset — that's precisely why the surrounding code has a comment warning not to use it directly, yet the catch-block fallback does exactly that, silently.
   3. Teradata's own IT test is `@Disabled("Disabled because it needs user's personal teradata account to run this test!")` (`JdbcTeradataIT.java:37`) and Vertica's is `@Disabled` pending a usable container image (`JdbcVerticaIT.java:38`) — confirmed by reading both files directly. So the two dialects with the weakest value-path guarantee are also the two with no possible way to catch a regression here in this repo's CI, now or in the future without infrastructure changes.
   4. Separately: `TeradataTypeMapper`/`VerticaTypeMapper`'s `mapping(ResultSetMetaData, int)` switches on the raw, un-canonicalized `getColumnTypeName(...)` with no paren-stripping — so it cannot match a precision-qualified name like `TIMESTAMP(6) WITH TIME ZONE`. I confirmed this PR's own `TimestampWithTimeZoneTypeMappingTest.testTableMetadataFallbackRecognizesProprietaryTypeCodes` asserts Teradata reports exactly `"TIMESTAMP(6) WITH TIME ZONE"` — but that assertion goes through `JdbcColumnConverter`'s regex-based fallback, not through `TeradataTypeMapper.mapping()` itself, where the same precision-qualified string would fall to `default:` and throw. `JdbcColumnConverter` (regex) and `PrestoTypeMapper` (explicit canonicalization) both handle this correctly; Teradata/Vertica's own mappers do not.
   
   ## 1.2 Compatibility Impact
   
   **Partially incompatible in effect, not in API/config/SPI/serialization.** No option, public API, or checkpoint/savepoint state is touched. The one real behavioral flip: `JdbcColumnConverter.java` splits `TIMESTAMP_WITH_TIMEZONE` out of the previously-shared `TIMESTAMP` case in the generic fallback, so any existing job whose driver reports raw JDBC type `-101` through that fallback path — not just the five dialects named in this PR's title, but *any* mapper-less dialect routed there — will see its inferred schema flip from `TIMESTAMP` to `TIMESTAMP_TZ` on the next catalog discovery. `docs/en/introduction/concepts/incompatible-changes.md` already has a general "Breaking Change: Mapping of timezone-aware timestamp columns to `TIMESTAMP_TZ` type" entry from an earlier PR (#10685, same class of change, same author) with per-dialect sub-bullets (Snowflake, StarRocks, Hudi, CDC, Iceberg, Xugu) — this PR does not add a sub-bullet there for the newly-covered dialects (Db2, Presto, T
 eradata, Vertica, and the generic-fallback case), even though it follows the exact same established pattern that file's own convention calls for. This is a real, checkable documentation-completeness gap against the project's own established practice for this exact change class (Issue 5).
   
   ## 1.3 Performance / Side-Effect Analysis
   
   No new I/O, threads, or locks on a hot path; the regex/string canonicalization in `JdbcColumnConverter`/`PrestoTypeMapper` runs once per column at discovery time, not per row. `PrestoDialect.supportsPrimaryKeyMetadata()` now returning `false` changes runtime behavior for every Presto `table_path`-based job by skipping `getPrimaryKeys(...)` entirely in `CatalogUtils.getTableSchema(...)` — I traced this is a real, connected fix (not scope creep): `getPrimaryKey(...)` is exactly what previously ran unconditionally in that method, and this PR's own new test `testPrestoSkipsUnsupportedPrimaryKeyMetadata` confirms the change is deliberate. It's undisclosed in the PR description/docs, though — worth a one-line explanation of *why* Presto's PK metadata query needed to be skipped (Issue 7, non-blocking).
   
   ## 1.4 Error Handling and Logging
   
   See Issue 1 above/below — the silent fallback is the substantive error-handling gap in this diff. Everything else in the diff either throws loudly (`CommonError.convertToConnectorTypeError`/`convertToSeaTunnelTypeError` for unmapped types, `SQLException` for the Db2 reflective-call failure path) or is a pure, side-effect-free mapping addition.
   
   **Issue 1: Teradata/Vertica `TIMESTAMP_TZ` values flow exclusively through a fallback that can silently produce the wrong instant, with zero achievable value-path test coverage**
   - Location: `TeradataTypeMapper.java:95-96`, `VerticaTypeMapper.java:161-163` (routing), `JdbcFieldTypeUtils.java:201-212` (the actual fallback)
   - Problem: neither driver returns a `java.time` object or a `DBTimestamp`-like wrapper for a TZ column, so both land in the generic `Timestamp` branch, which re-reads via `getString()` and, on any unparseable rendering (e.g. a region-ID zone name instead of a numeric offset), silently substitutes `Timestamp.toInstant().atOffset(UTC)` — the exact conversion the method's own adjacent comment warns can shift the value by the JVM's default offset.
   - Potential risk: for a feature whose entire purpose is offset preservation, a previously loud discovery-time failure (`CommonError`) becomes a silent, plausible-looking, potentially wrong value at row-read time, specifically on the two dialects with no possible CI coverage in this repo today (Teradata `@Disabled`, needs a personal account; Vertica `@Disabled`, no usable container image).
   - Best improvement: Option A — implement real, driver-verified `TIMESTAMP_TZ` read overrides for Teradata/Vertica (mirroring the Db2 approach) backed by driver-mocked unit tests that exercise the actual value path, not just metadata mapping. Option B — scope Teradata and Vertica out of this PR's mappers and docs entirely, and land Db2/Presto/generic-JDBC-4.2 now (all three are proven with real evidence); revisit Teradata/Vertica once their value path has real coverage. I'd lean toward B given neither dialect can be exercised in this repo's CI as things stand.
   - Severity: High
   - Raised by another reviewer: No — my own finding.
   
   **Issue 2: Teradata/Vertica metadata mapping can't match a precision-qualified type name, contradicting this PR's own test fixture**
   - Location: `TeradataTypeMapper.java:66,95`, `VerticaTypeMapper.java:100,161-162`
   - Problem: both mappers switch on the raw, un-canonicalized column type name, so only the exact string `TIMESTAMP WITH TIME ZONE` matches, while `JdbcColumnConverter`'s regex and `PrestoTypeMapper`'s explicit canonicalization both correctly accept the precision-qualified form `TIMESTAMP(n) WITH TIME ZONE` — which this PR's own `TimestampWithTimeZoneTypeMappingTest` fixture asserts Teradata actually reports (just through a different code path than the one that would really run for a `query =`-configured Teradata source).
   - Potential risk: a Teradata/Vertica source configured with `query =` (a mainstream configuration path, not the catalog/table_path path) throws `CommonError.convertToSeaTunnelTypeError` on exactly the columns this PR advertises as newly supported. Loud, not silent, hence Medium rather than High.
   - Best improvement: extract a shared canonicalization helper (generalizing `JdbcColumnConverter`'s regex or `PrestoTypeMapper`'s prefix-check) and call it from both mappers' `mapping(...)` overrides, with a test that drives it through the mappers themselves rather than only through the fallback.
   - Severity: Medium
   - Raised by another reviewer: No.
   
   # 2. Code Quality Assessment
   
   ## 2.1 Coding Standards
   
   License headers, AOSP/Spotless formatting, no wildcard imports, no `System.out.println`, no special-symbol comments — all compliant on inspection. Comments explain *why* rather than restating code (e.g. the ordering-constraint comment in `PrestoTypeMapper`, the JVM-offset-shift warning in `JdbcFieldTypeUtils`). Non-blocking: `PrestoDialect.supportsPrimaryKeyMetadata()` has no explanatory comment for *why* Presto needs this override (1.3); the new Presto/Teradata/Vertica canonicalization calls plain `toUpperCase()` rather than `toUpperCase(Locale.ROOT)`, inconsistent with `JdbcColumnConverter`'s own `Locale.ROOT` usage added in this same PR (Issue 6, Low).
   
   ## 2.2 Test Coverage and Test Stability
   
   **Stability rating: Stable.** The Db2 unit test (`JdbcFieldTypeUtilsTest.testGetOffsetDateTimeFromDb2TimestampPreservesOffsetAndTruncatesPicos`) and the Presto E2E (`JdbcPrestoIT.testTimestampWithTimeZoneMappingAndValue`) are both deterministic: no `Thread.sleep`, `LIMIT 1` is safe against a fixed 3-row fixture, the Presto assertion pins the session zone via `timeZoneId=UTC` on the JDBC URL rather than depending on the runner's default zone, and both use strict `OffsetDateTime`/`assertEquals` comparisons rather than a weak "didn't throw" check. No flaky-test anti-patterns in the new/changed test code.
   
   Coverage gap — this is Issue 1's other half: Teradata has zero achievable value-path coverage in this repo today; Vertica's IT is disabled pending a container image. The new `TimestampWithTimeZoneTypeMappingTest` for both dialects only exercises `mapping(ResultSetMetaData, int)` via mocks (metadata/schema-shape correctness), never the row-value read that Issue 1 concerns — so the new tests genuinely improve discovery-time confidence but say nothing about the specific gap that's blocking this PR.
   
   ## 2.3 Documentation Updates
   
   `docs/en`/`docs/zh` `Jdbc.md` (source and sink) are updated in parallel and structurally consistent between languages. I spot-checked the factual claims against the code: the Db2 auto-table-creation limitation and the 12-fractional-digit truncation are both accurate. Gap: the docs give an unqualified "value is represented by `java.time.OffsetDateTime`" guarantee across all five dialects with no caveat for the two (Teradata, Vertica) whose value path is unproven per Issue 1 — and, per 1.2, no incompatible-changes.md sub-bullet for this PR's specific dialects (Issue 5, Medium, non-blocking on its own but connected to Issue 1's severity).
   
   # 3. Architectural Soundness
   
   ## 3.1 Elegance of the Solution
   
   Each change lands at the layer that owns the concern — per-dialect mappers/converters for schema mapping, the shared `AbstractJdbcRowConverter`/`JdbcFieldTypeUtils` for value conversion, the generic fallback for mapper-less dialects. The Presto reordering fix is a small, surgical correction to a genuine pre-existing bug. The one structural inconsistency: type-name recognition for the "with time zone" pattern is expressed three different ways across this PR (regex in the shared fallback, explicit prefix-check in Presto, exact-string switch in Teradata/Vertica) — this PR synced Presto's canonicalization but not Teradata/Vertica's, which is the direct root cause of Issue 2. A single shared predicate used by all four native-type-name-based mappers would remove this class of drift permanently — this is a **precise fix for Db2/Presto/generic**, but a **partial/incomplete fix for Teradata/Vertica** given Issues 1 and 2.
   
   ## 3.2 Maintainability
   
   Solid overall: constants carry rationale, ordering constraints are commented where they matter. `normalizeDb2OffsetDateTimeString` is invoked from the shared `parseOffsetDateTimeFromString` rather than scoped to the Db2-only call site — harmless given how specific its regex is (it only matches Db2's `yyyy-mm-dd-hh.mm.ss` external format), but it's slightly wider coupling than strictly needed. The reflective `toDBString(boolean)` call has no compile-time safety net against a driver upgrade changing that method's signature, but fails loud via `SQLException` rather than silently, which is the right failure mode if it ever breaks.
   
   ## 3.3 Extensibility
   
   The per-dialect mapper/converter split and the new `supportsPrimaryKeyMetadata()` hook are both clean extension seams. Extracting the shared type-name-recognition predicate discussed in 3.1 would directly resolve Issue 2 and make the next dialect's "with time zone" support trivial to add correctly.
   
   ## 3.4 Historical-Version Compatibility
   
   No serialization, checkpoint/savepoint, config option, or public API surface is touched by this diff — a job restored from an existing checkpoint is unaffected at the state level. The only historical-compatibility consideration is the inferred-schema flip covered in 1.2, which the project's existing general `incompatible-changes.md` entry already covers as a change class; a per-dialect sub-bullet for this PR's five dialects would be a precision improvement consistent with that file's own established convention, not a net-new compatibility requirement.
   
   # 4. Issue Summary
   
   | # | Issue | Location | Severity |
   |---|-------|----------|----------|
   | 1 | Teradata/Vertica `TIMESTAMP_TZ` values flow only through a fallback that can silently produce the wrong instant on parse failure; zero achievable value-path test coverage | `TeradataTypeMapper.java:95-96`, `VerticaTypeMapper.java:161-163`, `JdbcFieldTypeUtils.java:201-212` | High |
   | 2 | Teradata/Vertica metadata mapping can't match `TIMESTAMP(n) WITH TIME ZONE`, contradicting this PR's own test fixture | `TeradataTypeMapper.java:66,95`, `VerticaTypeMapper.java:100,161-162` | Medium |
   | 3 | No incompatible-changes.md sub-bullet for this PR's specific dialects, despite the project's own established convention for this exact change class | `docs/en/introduction/concepts/incompatible-changes.md` | Medium |
   | 4 | `PrestoDialect.supportsPrimaryKeyMetadata()` behavior change is real and tested but undisclosed/uncommented as to *why* | `PrestoDialect.java:43-46` | Low |
   | 5 | Db2 `DBTimestamp` access uses reflection despite `db2jcc` already being a compile-scope dependency used directly in this PR's own test | `JdbcFieldTypeUtils.java:186-196` | Low |
   | 6 | Presto/Teradata/Vertica canonicalization uses locale-sensitive `toUpperCase()` instead of `Locale.ROOT`, inconsistent with `JdbcColumnConverter` in the same PR | `PrestoTypeMapper.java:71`, `TeradataTypeMapper.java:66`, `VerticaTypeMapper.java:100` | Low |
   | 7 | Docs give an unqualified `OffsetDateTime`-preservation guarantee for all five dialects with no caveat for the two whose value path is unproven | `docs/en(zh)/connectors/source/Jdbc.md` | Low, follows from Issue 1 |
   
   # 5. Merge Recommendation
   
   ### Conclusion: Not recommended for merge
   
   1. **Blockers — must be fixed**
      - Issue 1 (High): give Teradata/Vertica a real, driver-verified `TIMESTAMP_TZ` value-read path, or scope both out of this PR's mappers/docs and land the proven Db2/Presto/generic-JDBC-4.2 work now.
      - Issue 2 (Medium, blocking as-is because it leaves the same two dialects half-delivered against their own advertised contract): make Teradata/Vertica's metadata mapping recognize the precision-qualified form. This dissolves automatically if Issue 1 is resolved via the scope-out option.
      - **Gate, not code:** the branch must be rebased onto current `dev` — it's currently `61` commits behind with `mergeable: CONFLICTING` / `mergeStateStatus: DIRTY`. This is independent of Issues 1-2 and needs to happen regardless of which fix direction is chosen.
   
   2. **Recommended fixes — non-blocking**
      - Issues 3-7 as itemized above (incompatible-changes.md sub-bullet, `PrestoDialect` disclosure comment, Db2 reflection-vs-direct-import simplification, `Locale.ROOT` consistency, doc caveat scoped to the proven dialects).
   
   **Option A vs Option B:** (A) finish Teradata/Vertica's value-path properly in this PR — the row-converter seam already exists, so this is plausible; or (B) land the proven Db2/Presto/generic-JDBC-4.2 work now and split Teradata/Vertica into a follow-up once their value path has real, achievable coverage. I'd lean toward (B): it ships three of five dialects against fully verified evidence (a real Presto container with exact-instant assertions, and Db2's reflection-based offset recovery which I traced end-to-end against the actual `DBTimestamp` class this module already depends on) without letting two currently-untestable dialects hold up work that's already solid.
   
   **CI:** green on the current head (`Build`, `Notify test workflow`, `labeler` all pass) — not itself a blocker, and unaffected by any of the issues above since none of them are exercised by CI-reachable tests.
   
   **Overall assessment:** the Db2, Presto, and generic-JDBC-4.2 legs of this PR are genuinely well-built and thoroughly verified — the Presto ordering fix in particular closes a real silent-data-loss bug with solid container-based proof, and the Db2 doc already gets ahead of its own auto-table-creation limitation rather than leaving users to discover it. But Teradata and Vertica are given the identical "offset preserved" promise in the docs and type mappers as the three proven dialects, without the value-path correctness or achievable test coverage to back that promise — and that's a real risk for a feature whose entire point is not silently losing timezone information. I'd merge confidently today if this were scoped to Db2/Presto/generic, or if Issue 1 were closed with real coverage for Teradata/Vertica; as-is, I'm not approving my own PR.
   
   As the author, this review is a technical self-check recorded as a plain comment; it does not count toward the approval gate. A write-capable maintainer still needs to review and approve once Issues 1-2 and the rebase are resolved.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Connector-V2] Support remaining JDBC TIMESTAMP_TZ types [seatunnel]

Posted by "davidzollo (via GitHub) via commits" <co...@seatunnel.apache.org>.
davidzollo commented on PR #11485:
URL: https://github.com/apache/seatunnel/pull/11485#issuecomment-7079011799

   Thanks @SEZ9. The review feedback has been addressed in commit `606aedb215e94bc0259eed60ac7a8c7c801ecb9f`:
   
   - **Issue 1 & 4 (Incompatible changes & migration notes)**: Updated `incompatible-changes.md` (EN and ZH) to explicitly document the Trino/Presto `timestamp(p) with time zone` behavior change and the native-type fallback retyping.
   - **Issue 2 & 3 (Db2 DBTimestamp reflective read & error handling)**: Cached the reflective method in `JdbcFieldTypeUtils` and added context-rich exception wrapping with column name and value details on failure.
   - **Issue 5 (Db2 sink documentation)**: Clarified in `docs/en|zh/connectors/sink/Jdbc.md` that Db2 auto table creation does not support `TIMESTAMP_TZ` columns without a pre-existing target schema.
   - **Issue 6 (Db2 & Vertica source documentation)**: Added `TIMESTAMP WITH TIME ZONE` and `TIMESTAMPTZ` entries to the Db2 and Vertica connector-specific type mapping documentation pages (EN and ZH).
   
   Fork Build [45009804842](https://github.com/DanielLeens/seatunnel/actions/runs/45009804842) is queued on this head. Ready for re-review.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org