apache/seatunnel · error · SeaTunnelTextFormatException

UNSUPPORTED_DATA_TYPE

UNSUPPORTED_DATA_TYPE

Error message

SeaTunnel format text not supported for parsing this type [%s]

What it means

Thrown by TextSerializationSchema.convert when a field's SeaTunnel SqlType has no string-encoding implementation for the text format. The format supports primitives, temporal types and nested ROW via level-based separators; anything else (e.g. unsupported MAP/array cases) hits the default branch and throws SeaTunnelTextFormatException with UNSUPPORTED_DATA_TYPE.

Source

Thrown at seatunnel-formats/seatunnel-format-text/src/main/java/org/apache/seatunnel/format/text/TextSerializationSchema.java:238

                                                        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 SeaTunnelTextFormatException(
                        CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,
                        String.format(
                                "SeaTunnel format text not supported for parsing this type [%s]",
                                fieldType.getSqlType()));
        }
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Change complex fields to supported types (primitives/strings) via an upstream transform before the text sink
  2. Switch the sink format from text to json, which supports nested MAP/ARRAY/ROW types
  3. Reduce nesting depth to what the text format's separator levels support, or configure separators for the needed level

Example fix

// before (sink schema)
field_meta = map<string,string>  // not string-encodable here

// after
field_meta = string  // upstream: JSON-encode the map yourself
Defensive patterns

Strategy: validation

Validate before calling

Set<SqlType> textWritable = Set.of(SqlType.STRING, SqlType.BOOLEAN, SqlType.TINYINT,
    SqlType.SMALLINT, SqlType.INT, SqlType.BIGINT, SqlType.FLOAT, SqlType.DOUBLE,
    SqlType.DECIMAL, SqlType.DATE, SqlType.TIME, SqlType.TIMESTAMP,
    SqlType.TIMESTAMP_TZ, SqlType.ROW);
if (!textWritable.contains(fieldType.getSqlType())) {
    throw new IllegalArgumentException("Type not text-encodable: " + fieldType.getSqlType());
}

Type guard

boolean isTextEncodable(SeaTunnelDataType<?> t) {
    switch (t.getSqlType()) {
        case STRING: case BOOLEAN: case TINYINT: case SMALLINT: case INT: case BIGINT:
        case FLOAT: case DOUBLE: case DECIMAL: case DATE: case TIME:
        case TIMESTAMP: case TIMESTAMP_TZ: case ROW:
            return true;
        default:
            return false; // e.g. MAP beyond supported levels
    }
}

Try / catch

try {
    byte[] bytes = textSchema.serialize(row);
} catch (SeaTunnelTextFormatException e) {
    log.error("Field type not supported by text format: {}", e.getMessage());
    throw e;
}

Prevention

When it happens

Trigger: serialize -> convert on a field whose fieldType.getSqlType() is outside the supported set — commonly MAP types, arrays of unsupported elements, or other composite types while writing text output (e.g. to Kafka).

Common situations: Sink schema containing MAP columns or nested structures deeper than the configured separators; using the text format for data better suited to the json format; schema drift introducing new types after the text sink was configured.

Related errors


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