apache/seatunnel · error · SeaTunnelCsvFormatException

UNSUPPORTED_DATA_TYPE

UNSUPPORTED_DATA_TYPE

Error message

SeaTunnel format text not supported for parsing this type [${sqlType}]

What it means

During CSV serialization, convert() handles primitive types, arrays, and rows; any other SqlType (e.g. MAP) falling into the default branch throws SeaTunnelCsvFormatException(UNSUPPORTED_DATA_TYPE) because text CSV cannot represent that type.

Solutions

  1. Change the column type to a CSV-supported one (primitives, arrays, nested rows).
  2. Add a transform that converts MAP columns to JSON strings before the CSV sink.
  3. Use a JSON sink instead of CSV if structured/map data must be preserved.

Example fix

// before
field = {name = "props", type = "map<string,string>"}
// after
field = {name = "props", type = "string"} // serialize map to JSON string upstream
Defensive patterns

Strategy: validation

Validate before calling

for (SeaTunnelType<?> t : rowType.getFieldTypes()) { check(!containsUnsupportedSqlType(t), "MAP not serializable to CSV"); }

Try / catch

try { sink.write(row); } catch (SeaTunnelCsvFormatException e) { /* convert map columns to strings */ }

Prevention

When it happens

Trigger: Serializing a SeaTunnelRow whose schema includes a MAP (or other unsupported) column to a CSV sink.

Common situations: Piping JSON/Kafka/Debezium sources that contain map fields directly into a CSV sink without transformation.

Related errors


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

Appendix: source

Thrown at seatunnel-formats/seatunnel-format-csv/src/main/java/org/apache/seatunnel/format/csv/CsvSerializationSchema.java:256

                                                        convert(entry.getKey(), keyType, level + 1),
                                                        convert(
                                                                entry.getValue(),
                                                                valueType,
                                                                level + 1)))
                                .collect(Collectors.joining(separators[level + 1]));
            case ROW:
                Object[] fields = ((SeaTunnelRow) field).getFields();
                String[] strings = new String[fields.length];
                for (int i = 0; i < fields.length; i++) {
                    strings[i] =
                            convert(
                                    fields[i],
                                    ((SeaTunnelRowType) fieldType).getFieldType(i),
                                    level + 1);
                }
                return String.join(separators[level + 1], strings);
            default:
                throw new SeaTunnelCsvFormatException(
                        CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,
                        String.format(
                                "SeaTunnel format text not supported for parsing this type [%s]",
                                fieldType.getSqlType()));
        }
    }

    private String addQuotesUsingCSVFormat(String fieldValue) {
        CSVFormat.Builder builder = CSVFormat.DEFAULT.builder().setRecordSeparator("");
        switch (quoteMode) {
            case ALL:
                builder.setQuoteMode(QuoteMode.ALL);
                break;
            case MINIMAL:
                builder.setQuoteMode(QuoteMode.MINIMAL);
                break;
            case NONE:
                builder.setQuoteMode(QuoteMode.NONE);

View on GitHub (pinned to cf67b549a7)