apache/seatunnel · warning

The timestamp_tz column

Error message

The timestamp_tz column {} type timestamptz({}) is out of range, which exceeds the maximum scale of {}, it will be converted to timestamptz({})

What it means

WARN log from RedshiftTypeConverter.reconvert for TIMESTAMP_TZ (timestamptz) columns. If the declared scale exceeds MAX_TIMESTAMP_SCALE, the converter clamps it and logs this warning; the generated timestamptz(p) DDL uses the clamped scale. Sub-second precision beyond the cap is lost.

Solutions

  1. Cast the column to a supported timestamptz scale before the sink
  2. Pre-create the Redshift table with the desired timestamptz(p)
  3. Accept the clamped scale
Defensive patterns

Strategy: validation

Validate before calling

if (col.getScale() != null && col.getScale() > maxTimestampScale) {
    // CAST(ts AS TIMESTAMPTZ(maxTimestampScale)) before the sink
}

Type guard

boolean timestamptzScaleFits(Integer scale, int max) { return scale == null || scale <= max; }

Prevention

When it happens

Trigger: Auto-creating a Redshift table where a TIMESTAMP_TZ column's getScale() exceeds MAX_TIMESTAMP_SCALE; raised in reconvert().

Common situations: Sources with timezone-aware timestamps at nanosecond precision (e.g. PostgreSQL timestamptz(6+), protobuf Timestamp) written to Redshift with auto table creation.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/a29f9b04c4c09a4e. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/redshift/RedshiftTypeConverter.java:380

                    timestampScale = MAX_TIMESTAMP_SCALE;
                    log.warn(
                            "The timestamp column {} type timestamp({}) is out of range, "
                                    + "which exceeds the maximum scale of {}, "
                                    + "it will be converted to timestamp({})",
                            column.getName(),
                            column.getScale(),
                            MAX_TIMESTAMP_SCALE,
                            timestampScale);
                }
                builder.columnType(REDSHIFT_TIMESTAMP);
                builder.dataType(REDSHIFT_TIMESTAMP);
                builder.scale(timestampScale);
                break;
            case TIMESTAMP_TZ:
                Integer timestampTzScale = column.getScale();
                if (timestampTzScale != null && timestampTzScale > MAX_TIMESTAMP_SCALE) {
                    timestampTzScale = MAX_TIMESTAMP_SCALE;
                    log.warn(
                            "The timestamp_tz column {} type timestamptz({}) is out of range, "
                                    + "which exceeds the maximum scale of {}, "
                                    + "it will be converted to timestamptz({})",
                            column.getName(),
                            column.getScale(),
                            MAX_TIMESTAMP_SCALE,
                            timestampTzScale);
                }
                builder.columnType(REDSHIFT_TIMESTAMPTZ);
                builder.dataType(REDSHIFT_TIMESTAMPTZ);
                builder.scale(timestampTzScale);
                break;
            case MAP:
            case ARRAY:
            case ROW:
                builder.columnType(REDSHIFT_SUPER);
                builder.dataType(REDSHIFT_SUPER);
                break;

View on GitHub (pinned to cf67b549a7)