apache/seatunnel · error · SeaTunnelJsonFormatException

UNSUPPORTED_DATA_TYPE

UNSUPPORTED_DATA_TYPE

Error message

SeaTunnel can not parse this date format [%s] of field [%s]

What it means

For DATE fields delivered as strings, the converter matches the string against a set of known date formatters (DateUtils.matchDateFormatter). If no formatter matches, the format cannot interpret the value and throws SeaTunnelJsonFormatException with UNSUPPORTED_DATA_TYPE. Only recognized date patterns can be converted to a SeaTunnelDate.

Source

Thrown at seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/debezium/DebeziumRowConverter.java:127

                return value.asText();
            case BYTES:
                try {
                    return value.binaryValue();
                } catch (IOException e) {
                    throw new RuntimeException("Invalid bytes field", e);
                }
            case DATE:
                String dateStr = value.asText();
                if (value.canConvertToLong()) {
                    return LocalDate.ofEpochDay(Long.parseLong(dateStr));
                }
                DateTimeFormatter dateFormatter = fieldFormatterMap.get(fieldName);
                if (dateFormatter == null) {
                    dateFormatter = DateUtils.matchDateFormatter(dateStr);
                    fieldFormatterMap.put(fieldName, dateFormatter);
                }
                if (dateFormatter == null) {
                    throw new SeaTunnelJsonFormatException(
                            CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,
                            String.format(
                                    "SeaTunnel can not parse this date format [%s] of field [%s]",
                                    dateStr, fieldName));
                }
                return dateFormatter.parse(dateStr).query(TemporalQueries.localDate());
            case TIME:
                String timeStr = value.asText();
                if (value.canConvertToLong()) {
                    long time = Long.parseLong(timeStr);
                    if (timeStr.length() == 8) {
                        time = TimeUnit.SECONDS.toMicros(time);
                    } else if (timeStr.length() == 11) {
                        time = TimeUnit.MILLISECONDS.toMicros(time);
                    }
                    return LocalTime.ofNanoOfDay(time);
                }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Clean/normalize the source column to an ISO format (yyyy-MM-dd) or a supported pattern
  2. Add a custom date converter/SMT in Debezium to emit ISO-8601 dates
  3. Pre-parse the field upstream (e.g. in a transform) so it arrives as a number (epoch days) instead of a string
  4. Extend DateUtils.matchDateFormatter with the needed pattern if the format is legitimate and recurring

Example fix

// before: source emits '12/31/2026'
// after: Debezium SMT normalizes to ISO
"transforms": "dateFmt",
"transforms.dateFmt.type": "org.apache.seatunnel...TimestampConverter$Value",
"transforms.dateFmt.field": "birth_date",
"transforms.dateFmt.target.type": "Date",
"transforms.dateFmt.format": "yyyy-MM-dd"
Defensive patterns

Strategy: try-catch

Validate before calling

String s = payload.get("dateField").asText();
if (java.time.LocalDate.parse(s) == null) { /* not ISO */ }
// or pre-check with the same formatter set used by DateUtils.matchDateFormatter

Try / catch

try {
    row = converter.parse(payload);
} catch (SeaTunnelJsonFormatException e) {
    if (e.getMessage().contains("can not parse this date format")) {
        log.error("Normalize source date column to yyyy-MM-dd or add a matching formatter", e);
    }
    throw e;
}

Prevention

When it happens

Trigger: getValue() on a DATE field whose asText() produces a string (e.g. "31/12/2026" or "2026-13-01") that matches none of the supported patterns; also canExtendToDate fails so the string path is taken and matchDateFormatter returns null.

Common situations: Source columns typed as text with locale-specific or non-ISO date formats; Debezium converters emitting dates in unexpected formats; data quality issues (invalid dates like 2026-02-30) in the source database.

Related errors


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