apache/seatunnel · error · SeaTunnelRuntimeException

COMMON-32

COMMON-32

Error message

The date format '<date>' of field '<field>' is not supported. Please check the date format.

What it means

TextDeserializationSchema.convert() throws this when a field declared as DATE in the row type cannot be matched to any known date pattern by DateUtils.matchDateFormatter(field). CommonError.formatDateError signals the raw text value is not a recognizable date string.

Source

Thrown at seatunnel-formats/seatunnel-format-text/src/main/java/org/apache/seatunnel/format/text/TextDeserializationSchema.java:317

                return Long.parseLong(field);
            case FLOAT:
                return Float.parseFloat(field);
            case DOUBLE:
                return Double.parseDouble(field);
            case DECIMAL:
                return new BigDecimal(field);
            case NULL:
                return null;
            case BYTES:
                return field.getBytes(StandardCharsets.UTF_8);
            case DATE:
                DateTimeFormatter dateFormatter = fieldFormatterMap.get(fieldName);
                if (dateFormatter == null) {
                    dateFormatter = DateUtils.matchDateFormatter(field);
                    fieldFormatterMap.put(fieldName, dateFormatter);
                }
                if (dateFormatter == null) {
                    throw CommonError.formatDateError(field, fieldName);
                }

                return dateFormatter.parse(field).query(TemporalQueries.localDate());
            case TIME:
                TemporalAccessor parsedTime = TIME_FORMAT.parse(field);
                return parsedTime.query(TemporalQueries.localTime());
            case TIMESTAMP:
                DateTimeFormatter dateTimeFormatter = fieldFormatterMap.get(fieldName);
                if (dateTimeFormatter == null) {
                    dateTimeFormatter = DateTimeUtils.matchDateTimeFormatter(field);
                    fieldFormatterMap.put(fieldName, dateTimeFormatter);
                }
                if (dateTimeFormatter == null) {
                    throw CommonError.formatDateTimeError(field, fieldName);
                }

                TemporalAccessor parsedTimestamp = dateTimeFormatter.parse(field);
                LocalTime localTime = parsedTimestamp.query(TemporalQueries.localTime());

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Inspect the offending value printed in the error message and compare against supported patterns in DateUtils.matchDateFormatter.
  2. Fix the source data to a supported date format (e.g. yyyy-MM-dd).
  3. Change the column type in the catalog to STRING and convert manually after read.
  4. Pre-clean the text file (normalize date separators, strip whitespace).
  5. If a new format is genuinely needed, extend DateUtils with the pattern or configure a custom date format option.

Example fix

// before (data)
2024/05/06
// after
2024-05-06
Defensive patterns

Strategy: validation

Validate before calling

boolean isSupportedDate(String v) {
    return v != null && v.matches("\\d{4}-\\d{2}-\\d{2}");
}
// pre-check each DATE column value against this before ingestion

Try / catch

try {
    LocalDate d = (LocalDate) schema.deserialize(bytes);
} catch (Exception e) {
    log.error("Date field unparsable: {}", e.getMessage());
    // dead-letter the record or default the date
}

Prevention

When it happens

Trigger: Deserializing a text (CSV/txt) column mapped to SeaTunnel DATE type where the string does not match any supported date pattern (e.g. '2024/13/01', '01-02-2024' if not in pattern list, or an empty/garbage value). The formatter cache is populated per field name; if the first lookup fails, every row fails.

Common situations: CSV export using a locale-specific date format (dd.MM.yyyy); spreadsheet-exported dates like 'Jan 5, 2024'; accidentally mapping a string column to DATE; leading/trailing whitespace in the field.

Related errors


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