apache/seatunnel · warning

The time column {} type time({}) is out of range, which exce

Error message

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

What it means

WARN log from RedshiftTypeConverter.reconvert for TIME columns. If the column's declared fractional-second scale exceeds MAX_TIME_SCALE, the converter caps it at the maximum and logs this warning; the generated time(p) DDL uses the clamped scale. Sub-second precision beyond the cap is lost.

Source

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

                } else {
                    builder.columnType(
                            String.format(
                                    "%s(%d)", REDSHIFT_BINARY_VARYING, MAX_BINARY_VARYING_LENGTH));
                    builder.dataType(REDSHIFT_BINARY_VARYING);
                    log.warn(
                            "The length of binary column {} is {}, which exceeds the maximum length of {}, "
                                    + "the length will be set to {}",
                            column.getName(),
                            column.getColumnLength(),
                            MAX_BINARY_VARYING_LENGTH,
                            MAX_BINARY_VARYING_LENGTH);
                }
                break;
            case TIME:
                Integer timeScale = column.getScale();
                if (timeScale != null && timeScale > MAX_TIME_SCALE) {
                    timeScale = MAX_TIME_SCALE;
                    log.warn(
                            "The time column {} type time({}) is out of range, "
                                    + "which exceeds the maximum scale of {}, "
                                    + "it will be converted to time({})",
                            column.getName(),
                            column.getScale(),
                            MAX_SCALE,
                            timeScale);
                }
                builder.columnType(REDSHIFT_TIME);
                builder.dataType(REDSHIFT_TIME);
                builder.scale(timeScale);
                break;
            case TIMESTAMP:
                Integer timestampScale = column.getScale();
                if (timestampScale != null && timestampScale > MAX_TIMESTAMP_SCALE) {
                    timestampScale = MAX_TIMESTAMP_SCALE;
                    log.warn(
                            "The timestamp column {} type timestamp({}) is out of range, "

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Round/truncate the time scale in the source or a transform to <= MAX_TIME_SCALE
  2. Pre-create the Redshift table with the exact time(p) precision you want
  3. Accept the conversion if losing sub-second precision is acceptable
Defensive patterns

Strategy: validation

Validate before calling

if (col.getScale() != null && col.getScale() > maxTimeScale) {
    // cast time column to time(maxTimeScale) upstream
}

Type guard

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

Prevention

When it happens

Trigger: Sink-side auto table creation where a TIME column has getScale() > MAX_TIME_SCALE; raised in reconvert() during TIME case handling.

Common situations: Sources with nanosecond-precision times (e.g. some databases or data formats with scale 9) written to Redshift, which supports fewer fractional digits.

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/434fa0ee11a77341. Report an issue: GitHub.