apache/seatunnel · error · SeaTunnelTextFormatException

UNSUPPORTED_DATA_TYPE

UNSUPPORTED_DATA_TYPE

Error message

SeaTunnel array not support this data type [%s]

What it means

Thrown by TextDeserializationSchema.convert when deserializing an ARRAY column whose element type is not one of the supported primitives/temporal types. The text format splits array elements as strings and only knows how to materialize typed arrays (including typed LocalTime/LocalDateTime/OffsetDateTime arrays) for the enumerated element types.

Source

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

                        return objectArrayList.toArray(new Integer[0]);
                    case BIGINT:
                        return objectArrayList.toArray(new Long[0]);
                    case FLOAT:
                        return objectArrayList.toArray(new Float[0]);
                    case DOUBLE:
                        return objectArrayList.toArray(new Double[0]);
                    case DECIMAL:
                        return objectArrayList.toArray(new BigDecimal[0]);
                    case DATE:
                        return objectArrayList.toArray(new LocalDate[0]);
                    case TIME:
                        return objectArrayList.toArray(new LocalTime[0]);
                    case TIMESTAMP:
                        return objectArrayList.toArray(new LocalDateTime[0]);
                    case TIMESTAMP_TZ:
                        return objectArrayList.toArray(new OffsetDateTime[0]);
                    default:
                        throw new SeaTunnelTextFormatException(
                                CommonErrorCode.UNSUPPORTED_DATA_TYPE,
                                String.format(
                                        "SeaTunnel array not support this data type [%s]",
                                        elementType.getSqlType()));
                }
            case MAP:
                SeaTunnelDataType<?> keyType = ((MapType<?, ?>) fieldType).getKeyType();
                SeaTunnelDataType<?> valueType = ((MapType<?, ?>) fieldType).getValueType();
                LinkedHashMap<Object, Object> objectMap = new LinkedHashMap<>();
                String[] kvs = field.split(separators[level + 1]);
                for (String kv : kvs) {
                    String[] splits = kv.split(separators[level + 2]);
                    if (splits.length < 2) {
                        objectMap.put(convert(splits[0], keyType, level + 1, fieldName), null);
                    } else {
                        objectMap.put(
                                convert(splits[0], keyType, level + 1, fieldName),
                                convert(splits[1], valueType, level + 1, fieldName));

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Flatten the data: change the element type to a supported primitive/temporal or parse complex arrays upstream
  2. Switch the format to one supporting nested types (e.g. json) for ARRAY<ROW>/ARRAY<MAP> payloads
  3. Pre-process the raw string in a custom transform and build the typed array yourself

Example fix

// before (catalog schema)
field_tags = array<map<string,string>>  // unsupported element type in text format

// after
field_tags = array<string>              // store serialized maps as strings, parse later
Defensive patterns

Strategy: validation

Validate before calling

SqlType et = ((ArrayType) fieldType).getElementType().getSqlType();
Set<SqlType> ok = Set.of(SqlType.STRING, SqlType.BOOLEAN, SqlType.INT, SqlType.BIGINT,
    SqlType.FLOAT, SqlType.DOUBLE, SqlType.DATE, SqlType.TIME,
    SqlType.TIMESTAMP, SqlType.TIMESTAMP_TZ);
if (!ok.contains(et)) throw new IllegalArgumentException("Bad array element type: " + et);

Type guard

boolean isTextParsableArrayElement(SeaTunnelDataType<?> elementType) {
    switch (elementType.getSqlType()) {
        case STRING: case BOOLEAN: case INT: case BIGINT: case FLOAT: case DOUBLE:
        case DATE: case TIME: case TIMESTAMP: case TIMESTAMP_TZ:
            return true;
        default:
            return false;
    }
}

Try / catch

try {
    SeaTunnelRow row = schema.deserialize(rawBytes);
} catch (SeaTunnelTextFormatException e) {
    log.warn("Text format cannot parse array element type; skipping record", e);
}

Prevention

When it happens

Trigger: deserialize -> convert on a SeaTunnelRow field of SqlType ARRAY whose elementType.getSqlType() is not in the handled switch (e.g. ARRAY<MAP<...>>, ARRAY<ROW>, ARRAY<BYTES>), or nested convert recursion reaching an unsupported inner array element type.

Common situations: Kafka text source schema declaring arrays of complex element types; nested arrays or arrays of structs in a delimited text stream; catalog schema more expressive than the text format can parse.

Related errors


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