apache/seatunnel · error · AerospikeConnectorException

UNSUPPORTED_DATA_TYPE

UNSUPPORTED_DATA_TYPE

Error message

Invalid ARRAY type: 

What it means

mapSeaTunnelType() maps a SeaTunnel column type to an AerospikeDataType. When the SeaTunnel SQL type is ARRAY, it additionally asserts the concrete SeaTunnelDataType is an instance of ArrayType; if not (an ARRAY-typed type implemented by a different class), it throws AerospikeConnectorException with code UNSUPPORTED_DATA_TYPE. In practice this guards against array-like columns the converter cannot map, since ARRAY is otherwise forced to AerospikeDataType.BYTEARRAY.

Source

Thrown at seatunnel-connectors-v2/connector-aerospike/src/main/java/org/apache/seatunnel/connectors/seatunnel/aerospike/sink/AerospikeTypeConverter.java:83

            }
        }
    }

    private AerospikeDataType mapSeaTunnelType(SeaTunnelDataType<?> seaTunnelType) {
        switch (seaTunnelType.getSqlType()) {
            case STRING:
                return AerospikeDataType.STRING;
            case INT:
                return AerospikeDataType.INTEGER;
            case BIGINT:
                return AerospikeDataType.LONG;
            case DOUBLE:
                return AerospikeDataType.DOUBLE;
            case BOOLEAN:
                return AerospikeDataType.BOOLEAN;
            case ARRAY:
                if (!(seaTunnelType instanceof ArrayType)) {
                    throw new AerospikeConnectorException(
                            AerospikeErrorCode.UNSUPPORTED_DATA_TYPE,
                            "Invalid ARRAY type: " + seaTunnelType.getClass().getSimpleName());
                }
                return AerospikeDataType.BYTEARRAY;
            case DATE:
            case TIMESTAMP:
                return AerospikeDataType.LONG;
            default:
                throw new AerospikeConnectorException(
                        AerospikeErrorCode.UNSUPPORTED_DATA_TYPE,
                        "Unsupported SeaTunnel type: " + seaTunnelType.getSqlType());
        }
    }

    public AerospikeDataType getFieldType(String fieldName) {
        AerospikeDataType type = fieldTypeMapping.get(fieldName);
        if (type == null) {
            throw new AerospikeConnectorException(

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Change the column's SeaTunnel type to a standard ArrayType (e.g. ArrayType.INTEGER_ARRAY/STRING_ARRAY) in the source schema.
  2. Explicitly set 'field_types' for the array column in the sink config (e.g. field_types = {tags = BYTEARRAY}) so mapSeaTunnelType is bypassed for that field.
  3. Flatten or serialize the array to a string upstream (transform) so the column maps to STRING instead of ARRAY.
  4. If this comes from a third-party source plugin, report/fix the plugin to emit standard ArrayType instances.

Example fix

// before (source schema)
customListColumn : SqlType.ARRAY (not ArrayType)

// after
field_types = {customListColumn = BYTEARRAY}  // or use a standard ArrayType in the source
Defensive patterns

Strategy: validation

Validate before calling

for (int i = 0; i < rowType.getTotalFields(); i++) {
    SeaTunnelDataType<?> t = rowType.getFieldType(i);
    if (t.getSqlType() == SqlType.ARRAY && !(t instanceof ArrayType)) {
        throw new IllegalArgumentException("Column '" + rowType.getFieldName(i)
            + "' uses non-standard ARRAY type " + t.getClass().getName());
    }
}

Type guard

boolean isStandardArrayType(SeaTunnelDataType<?> t) {
    return t.getSqlType() != SqlType.ARRAY || t instanceof ArrayType;
}

Try / catch

try {
    new AerospikeTypeConverter(rowType, config);
} catch (AerospikeConnectorException e) {
    if (e.getCode() == AerospikeErrorCode.UNSUPPORTED_DATA_TYPE
            && e.getMessage().startsWith("Invalid ARRAY type")) {
        // set field_types for that column or change the source to ArrayType
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: AerospikeTypeConverter is built without field_types (auto-mapping path) and a column's SeaTunnelDataType reports SqlType.ARRAY but is not an ArrayType instance — e.g. a custom or Map/List-based type implementation, or a source plugin exposing arrays via a non-standard type class — during convertValue-time mapping in the constructor.

Common situations: Source connectors that model arrays with custom SeaTunnelDataType subclasses; upstream schema evolution replacing ArrayType with a map/list type whose SqlType still reports ARRAY; using a plugin version whose array type class differs from the connector's expectation.

Related errors


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