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

CsvDeserializationSchema.parseDate resolves a date-formatting strategy for a CSV column via DateUtils.matchDateFormatter and parses the string into a LocalDate. When no known formatter matches the string, CommonError.formatDateError is thrown, reporting the offending value and field name. The CSV date string uses a date format outside the set of patterns the CSV format recognizes.

Source

Thrown at seatunnel-formats/seatunnel-format-csv/src/main/java/org/apache/seatunnel/format/csv/CsvDeserializationSchema.java:351

                                    ((SeaTunnelRowType) fieldType).getFieldType(i),
                                    level + 1,
                                    fieldName + "." + eleFieldNames[i]);
                }
                return new SeaTunnelRow(objects);
            default:
                throw CommonError.unsupportedDataType(
                        "SeaTunnel", fieldType.getSqlType().toString(), fieldName);
        }
    }

    private LocalDate parseDate(String field, String fieldName) {
        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());
    }

    private LocalTime parseTime(String field) {
        try {
            TemporalAccessor parsedTime = TIME_FORMAT.parse(field);
            return parsedTime.query(TemporalQueries.localTime());
        } catch (DateTimeParseException e) {
            throw new SeaTunnelCsvFormatException(
                    CommonErrorCode.UNSUPPORTED_DATA_TYPE, "Invalid time format: " + field, e);
        }
    }

    private LocalDateTime parseTimestamp(String field, String fieldName) {
        DateTimeFormatter dateTimeFormatter =
                fieldFormatterMap.computeIfAbsent(

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check the field value printed in the error and confirm the actual date pattern used in the CSV file.
  2. Set the CSV format's date format option (schema-level date_format / field formatter) to match the file's pattern, e.g. 'yyyy/MM/dd' or 'dd-MM-yyyy'.
  3. Fix the source CSV so date cells use a supported pattern (prefer ISO 'yyyy-MM-dd'), or add a transform to normalize the column before deserialization.
  4. If the column is not reliably a date, type it as STRING in the schema and parse it downstream with an explicit formatter.

Example fix

// before: CSV cell '01/02/2024' with default date_format
schema { date = DATE }  // matchDateFormatter fails -> COMMON-32
// after
schema {
  date = DATE {
    format = "%Y/%m/%d"  // or fix CSV to 2024-02-01
  }
}
Defensive patterns

Strategy: validation

Validate before calling

// validate a sample date cell against the configured format before running the job
java.time.format.DateTimeFormatter fmt =
    java.time.format.DateTimeFormatter.ofPattern("yyyy/MM/dd");
try { java.time.LocalDate.parse(sampleCell, fmt); }
catch (java.time.format.DateTimeParseException e) {
  throw new IllegalArgumentException("CSV date cell '" + sampleCell + "' does not match pattern");
}

Try / catch

try {
  SeaTunnelRow row = deserializationSchema.deserialize(line);
} catch (org.apache.seatunnel.api.common.SeaTunnelRuntimeException e) {
  // COMMON-32: log field/payload, skip line or write to error file
  LOG.warn("Bad date in CSV line: {}", e.getFormattedMessage());
}

Prevention

When it happens

Trigger: Reading a CSV field mapped to a DATE SeaTunnel type where the cell text is not one of the recognized date patterns (e.g. '2024/13/01' invalid month, '01-02-2024' ambiguous unsupported ordering, or free-form text in a date column) and no csv schema date_format covers it.

Common situations: CSV exported from a locale using a non-ISO date order (DD/MM/YYYY vs YYYY-MM-DD); Excel exports with regional date formats; a date column containing empty or placeholder values ('N/A', '0000-00-00') mistaken for dates; schema column typed DATE while data is actually a datetime string.

Related errors


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