{"record":{"id":"57744b15540e1146","repo":"apache/seatunnel","slug":"timestamp-tz-is-written-to-xugu-as-a-plain-timesta","errorCode":null,"errorMessage":"TIMESTAMP_TZ is written to Xugu as a plain TIMESTAMP: the timezone offset is dropped and only the wall-clock value is stored. This is a known Xugu JDBC driver limitation (bug [E19138]).","messagePattern":"TIMESTAMP_TZ is written to Xugu as a plain TIMESTAMP: the timezone offset is dropped and only the wall-clock value is stored\\. This is a known Xugu JDBC driver limitation \\(bug \\[E19138\\]\\)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/xugu/XuguJdbcRowConverter.java","lineNumber":59,"sourceCode":"    public String converterName() {\n        return DatabaseIdentifier.XUGU;\n    }\n\n    @Override\n    protected void setValueToStatementByDataType(\n            Object value,\n            PreparedStatement statement,\n            SeaTunnelDataType<?> seaTunnelDataType,\n            int statementIndex,\n            @Nullable String sourceType)\n            throws SQLException {\n        if (seaTunnelDataType.getSqlType().equals(SqlType.TIMESTAMP_TZ)) {\n            // LOSSY PATH: Xugu JDBC driver crashes on batch writes of OffsetDateTime /\n            // timezone-formatted strings for TIMESTAMP WITH TIME ZONE columns (bug [E19138]).\n            // The timezone offset is intentionally dropped; only the wall-clock value is stored.\n            // This is a documented limitation — not silent data loss.\n            if (TIMESTAMP_TZ_WARNED.compareAndSet(false, true)) {\n                log.warn(\n                        \"TIMESTAMP_TZ is written to Xugu as a plain TIMESTAMP: the timezone\"\n                                + \" offset is dropped and only the wall-clock value is stored.\"\n                                + \" This is a known Xugu JDBC driver limitation (bug [E19138]).\");\n            }\n            OffsetDateTime odt = (OffsetDateTime) value;\n            statement.setTimestamp(statementIndex, Timestamp.valueOf(odt.toLocalDateTime()));\n        } else {\n            super.setValueToStatementByDataType(\n                    value, statement, seaTunnelDataType, statementIndex, sourceType);\n        }\n    }\n}\n","sourceCodeStart":41,"sourceCodeEnd":72,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/xugu/XuguJdbcRowConverter.java#L41-L72","documentation":"XuguJdbcRowConverter.setValueToStatementByDataType writes TIMESTAMP_TZ (OffsetDateTime) values. The Xugu JDBC driver crashes on batch writes of timezone-formatted values for TIMESTAMP WITH TIME ZONE columns (bug E19138), so the converter intentionally drops the offset and stores only the wall-clock Timestamp. This is lossy for the timezone component; the warning fires once per process (guarded by TIMESTAMP_TZ_WARNED).","triggerScenarios":"Writing any OffsetDateTime value with a non-UTC (or any) offset to a Xugu TIMESTAMP WITH TIME ZONE column via SeaTunnel JDBC sink, especially in batch mode.","commonSituations":"Syncing data from PostgreSQL/Oracle timestamptz sources into Xugu; multi-timezone applications where the offset matters for downstream consumers.","solutions":["Normalize all timestamps to a single timezone (e.g. UTC) upstream so dropping the offset is harmless","Change the Xugu target column to plain TIMESTAMP and document that only local time is stored","Upgrade the Xugu JDBC driver if a fix for E19138 becomes available and remove the workaround","Convert offsets manually in a transform before the sink if offsets must be preserved"],"exampleFix":"// before: OffsetDateTime with offset 2024-01-01T10:00+08:00 -> stored as 10:00 without offset\n// after: normalize upstream\nOffsetDateTime normalized = odt.withOffsetSameInstant(ZoneOffset.UTC);\n// stored as UTC wall-clock consistently","handlingStrategy":"fallback","validationCode":"// Ensure offsets are uniform before writing TIMESTAMP_TZ to Xugu:\nfor (OffsetDateTime v : values) {\n    if (!v.getOffset().equals(ZoneOffset.UTC)) {\n        log.warn(\"Non-UTC offset will be dropped for Xugu TIMESTAMP_TZ write: \" + v.getOffset());\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Normalize all timestamps to UTC before the Xugu sink","Avoid Xugu TIMESTAMP WITH TIME ZONE targets for multi-timezone data","Track Xugu JDBC driver releases for a fix to bug E19138","Treat Xugu TIMESTAMP_TZ columns as wall-clock-only in schema design"],"tags":["jdbc","xugu","timestamp","timezone","driver-limitation"],"backgroundTag":"type-mismatch","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}