apache/seatunnel · warning

The time column type time( ) is out of range, which exceeds…

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

This is a warning logged by XuguTypeConverter.reconvert when a SeaTunnel TIME column declares a fractional-second scale greater than the maximum supported by XuGu (MAX_TIME_SCALE). The converter clamps the scale down and proceeds; it does not throw. It exists so users know precision will be silently truncated when mapping to XUGU_TIME.

Solutions

  1. Reduce the source TIME scale to <= MAX_TIME_SCALE in the upstream table or in a Transform (e.g. cast/substring the time value).
  2. Let the converter clamp the scale (it is only a warning) and verify truncated precision is acceptable.
  3. Declare the column with an explicit smaller scale in your catalog table definition.

Example fix

// before: source column time(9)
// after: cast the column before the sink
SQL: CAST(time_col AS TIME(3)) AS time_col
Defensive patterns

Strategy: validation

Validate before calling

if (col.getSqlType() == SqlType.TIME && col.getColumnScale() > MAX_TIME_SCALE) {
    col = col.copy().setColumnScale(MAX_TIME_SCALE).build(); // clamp proactively
}

Type guard

boolean withinTimeScale(ColumnType c) { return c.getScale() == null || c.getScale() <= MAX_TIME_SCALE; }

Prevention

When it happens

Trigger: Catalog-based sink write to XuGu where the incoming SeaTunnel column is TIME with scale > MAX_TIME_SCALE (e.g. time(9) sourced from a high-precision upstream), so reconvert must clamp the scale.

Common situations: Copying TIME columns from MySQL/PostgreSQL with microsecond or nanosecond precision into XuGu, which supports fewer fractional digits; upstream schema auto-evolution propagating an over-precise time type.

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/51728a57e17ca5be. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/xugu/XuguTypeConverter.java:349

                    builder.columnType(
                            String.format("%s(%s)", XUGU_VARCHAR, column.getColumnLength()));
                    builder.dataType(XUGU_VARCHAR);
                } else {
                    builder.columnType(XUGU_CLOB);
                    builder.dataType(XUGU_CLOB);
                }
                break;
            case DATE:
                builder.columnType(XUGU_DATE);
                builder.dataType(XUGU_DATE);
                break;
            case TIME:
                builder.dataType(XUGU_TIME);
                if (column.getScale() != null && column.getScale() > 0) {
                    Integer timeScale = column.getScale();
                    if (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(String.format("%s(%s)", XUGU_TIME, timeScale));
                    builder.scale(timeScale);
                } else {
                    builder.columnType(XUGU_TIME);
                }
                break;
            case TIMESTAMP:
                if (column.getScale() == null || column.getScale() <= 0) {
                    builder.columnType(XUGU_TIMESTAMP);
                } else {

View on GitHub (pinned to cf67b549a7)