apache/seatunnel · error · java.lang.IllegalArgumentException

Unsupported SQL type:

Error message

Unsupported SQL type: 

What it means

createArrayConverter() maps the element SQL type of a SeaTunnel ARRAY column to a list-to-array converter. Only primitive/STRING element types are supported; any other element type throws IllegalArgumentException 'Unsupported SQL type'. This guards array deserialization for CDC values.

Source

Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/debezium/row/SeaTunnelRowDebeziumDeserializationConverters.java:213

        switch (elementType.getSqlType()) {
            case BOOLEAN:
                return (dbzObj, schema) ->
                        convertListToArray((List<Boolean>) dbzObj, Boolean.class);
            case SMALLINT:
                return (dbzObj, schema) -> convertListToArray((List<Short>) dbzObj, Short.class);
            case INT:
                return (dbzObj, schema) ->
                        convertListToArray((List<Integer>) dbzObj, Integer.class);
            case BIGINT:
                return (dbzObj, schema) -> convertListToArray((List<Long>) dbzObj, Long.class);
            case FLOAT:
                return (dbzObj, schema) -> convertListToArray((List<Float>) dbzObj, Float.class);
            case DOUBLE:
                return (dbzObj, schema) -> convertListToArray((List<Double>) dbzObj, Double.class);
            case STRING:
                return (dbzObj, schema) -> convertListToArray((List<String>) dbzObj, String.class);
            default:
                throw new IllegalArgumentException(
                        "Unsupported SQL type: " + elementType.getSqlType());
        }
    }

    @SuppressWarnings("unchecked")
    private static <T> T[] convertListToArray(List<T> list, Class<T> clazz) {
        T[] array = (T[]) java.lang.reflect.Array.newInstance(clazz, list.size());
        for (int i = 0; i < list.size(); i++) {
            array[i] = list.get(i);
        }
        return array;
    }

    private static DebeziumDeserializationConverter convertToBoolean() {
        return new DebeziumDeserializationConverter() {
            private static final long serialVersionUID = 1L;

            @Override

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Change the array element type in the schema to a supported one (numeric primitive or STRING).
  2. Serialize complex elements as STRING and decode downstream (e.g. JSON-stringified array).
  3. Extend createArrayConverter with a branch for the desired element type if you control the build.

Example fix

// before
ARRAY<DATE> tags // throws Unsupported SQL type: DATE
// after
ARRAY<STRING> tags // ISO date strings
Defensive patterns

Strategy: validation

Validate before calling

// Java
static boolean isSupportedArrayElement(SeaTunnelRowType arrayType) {
    switch (((SeaTunnelArrayType<?>) arrayType).getElementType().getSqlType()) {
        case BOOLEAN: case TINYINT: case SMALLINT: case INT: case BIGINT:
        case FLOAT: case DOUBLE: case STRING:
            return true;
        default:
            return false;
    }
}

Type guard

SqlType elem = elementType.getSqlType();
if (elem != SqlType.STRING && !elem.name().matches("BOOLEAN|TINYINT|SMALLINT|INT|BIGINT|FLOAT|DOUBLE")) {
    throw new IllegalArgumentException("ARRAY element not supported by CDC: " + elem);
}

Try / catch

try {
    conv = createArrayConverter(type);
} catch (IllegalArgumentException e) {
    log.warn("array element {} unsupported, falling back to STRING", elementType);
    conv = createConverter(STRING_TYPE, timeZone, factory);
}

Prevention

When it happens

Trigger: Creating a converter for an ARRAY column whose element type is not BOOLEAN/TINYINT/SMALLINT/INT/BIGINT/FLOAT/DOUBLE/STRING (e.g. ARRAY<DATE>, ARRAY<ROW>).

Common situations: Configuring a CDC source schema with arrays of complex or temporal element types; catalog type mapping produces an element type the converter does not know.

Related errors


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