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

When converting a TIME column to the Phoenix type, a scale (fractional-second precision) larger than Phoenix's maximum time scale (MAX_TIME_SCALE) cannot be mapped. The converter logs this warning and clamps the time scale to MAX_TIME_SCALE, so sub-second precision beyond that limit is dropped. Note the final log argument mistakenly prints MAX_SCALE, but the applied scale is MAX_TIME_SCALE.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/phoenix/PhoenixTypeConverter.java:289

                    builder.columnType(String.format("%s", PHOENIX_VARCHAR));
                } else if (column.getColumnLength() <= Integer.MAX_VALUE) {
                    builder.columnType(
                            String.format("%s(%s)", PHOENIX_VARCHAR, column.getColumnLength()));
                } else if (column.getColumnLength() > Integer.MAX_VALUE) {
                    builder.columnType(String.format("%s(%s)", PHOENIX_VARCHAR, Integer.MAX_VALUE));
                }

                builder.dataType(PHOENIX_VARCHAR);
                break;
            case DATE:
                builder.columnType(PHOENIX_DATE);
                builder.dataType(PHOENIX_DATE);
                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);
                }
                if (timeScale != null && timeScale > 0) {
                    builder.columnType(String.format("%s(%s)", PHOENIX_TIME, timeScale));
                } else {
                    builder.columnType(PHOENIX_TIME);
                }
                builder.dataType(PHOENIX_TIME);
                builder.scale(timeScale);
                break;
            case TIMESTAMP:
                Integer timestampScale = column.getScale();

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Reduce the time column scale at the source/catalog to <= MAX_TIME_SCALE.
  2. CAST the column upstream (e.g. CAST(t AS TIME(3))) before writing to Phoenix.
  3. Confirm the truncated precision is acceptable for your data based on the warning.
  4. If full fractional precision is required, sink to a store supporting higher time precision.

Example fix

// before
catalogColumn = CatalogColumn.of("event_time", TimeType(9));
// after
catalogColumn = CatalogColumn.of("event_time", TimeType(3));
Defensive patterns

Strategy: validation

Validate before calling

Integer scale = col.getScale();
if (col.getDataType() instanceof TimeType && scale != null && scale > maxTimeScale) {
    col = CatalogColumn.of(col.getName(), new TimeType(maxTimeScale), col.isNullable(), col.getDefaultValue());
}

Type guard

boolean fitsPhoenixTimeScale(CatalogColumn c) {
    Integer s = c.getScale();
    return !(c.getDataType() instanceof TimeType) || s == null || s <= 3;
}

Prevention

When it happens

Trigger: PhoenixTypeConverter.reconvert() on a CatalogColumn of type TIME with a non-null scale greater than MAX_TIME_SCALE (e.g. TIME(9) from a source supporting nanoseconds).

Common situations: Sources with micro/nanosecond time precision (e.g. certain RDBMS TIME(6)/TIME(9)) being written to Phoenix, 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/f2f295863a77e773. Report an issue: GitHub.