apache/seatunnel · error · IotdbConnectorException

CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE

CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE

Error message

Unsupported data type: {seaTunnelFieldType}

What it means

In DefaultSeaTunnelRowDeserializer, when converting an IoTDB INT32 field to a SeaTunnel field, only TINYINT/SMALLINT/INT target types are supported; any other SeaTunnelFieldType falls into the default branch and throws UNSUPPORTED_DATA_TYPE. The declared column type in the SeaTunnel schema cannot hold the IoTDB INT32 measurement value.

Source

Thrown at seatunnel-connectors-v2/connector-iotdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/iotdb/serialize/DefaultSeaTunnelRowDeserializer.java:80

            SeaTunnelDataType<?> seaTunnelFieldType = rowType.getFieldType(i);
            seaTunnelFields[i] = convert(seaTunnelFieldType, field);
        }
        return new SeaTunnelRow(seaTunnelFields);
    }

    private Object convert(SeaTunnelDataType<?> seaTunnelFieldType, Field field) {
        switch (field.getDataType()) {
            case INT32:
                Number int32 = field.getIntV();
                switch (seaTunnelFieldType.getSqlType()) {
                    case TINYINT:
                        return int32.byteValue();
                    case SMALLINT:
                        return int32.shortValue();
                    case INT:
                        return int32.intValue();
                    default:
                        throw new IotdbConnectorException(
                                CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,
                                "Unsupported data type: " + seaTunnelFieldType);
                }
            case INT64:
                return field.getLongV();
            case FLOAT:
                return field.getFloatV();
            case DOUBLE:
                return field.getDoubleV();
            case TEXT:
                return field.getStringValue();
            case BOOLEAN:
                return field.getBoolV();
            default:
                throw new IotdbConnectorException(
                        CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,
                        "Unsupported data type: " + field.getDataType());
        }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Change the SeaTunnel schema column type to INT (or SMALLINT/TINYINT) to match the IoTDB INT32 measurement
  2. Use a SQL cast / transform in the pipeline to convert the value to the desired type after reading
  3. Check IoTDB 'SHOW TIMESERIES' to confirm the storage data type, then align the source schema

Example fix

// before
SeaTunnelRowType rowType = new SeaTunnelRowType(new String[]{"time","temp"}, new SeaTunnelDataType[]{LocalDateTimeType.class... , new FloatType()});
// after (IoTDB field is INT32)
... new IntType() for the "temp" column ...
Defensive patterns

Strategy: validation

Validate before calling

// check declared type against IoTDB storage type
// SHOW TIMESERIES root.db.device1.s_temp => dataType=INT32
// ensure matching SeaTunnel column is IntType/SmallIntType/TinyIntType, not FloatType

Type guard

boolean int32Compatible(SeaTunnelDataType<?> t) {
    SqlType s = t.getSqlType();
    return s == SqlType.TINYINT || s == SqlType.SMALLINT || s == SqlType.INT;
}

Try / catch

try {
    Object v = deserializer.deserialize(field, fieldType);
} catch (IotdbConnectorException e) {
    if (e.getCode() == CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE) {
        // fix schema: INT32 IoTDB field must map to TINYINT/SMALLINT/INT
    } else { throw e; }
}

Prevention

When it happens

Trigger: Calling convert() on an IoTDB Field with data type INT32 while the corresponding SeaTunnelRowType column's SqlType is not TINYINT, SMALLINT, or INT (e.g. FLOAT, DOUBLE, STRING, BOOLEAN).

Common situations: User declared an IoTDB INT32 measurement as FLOAT/STRING in the SeaTunnel schema; auto catalog type mapping produced an unexpected type after an IoTDB version upgrade; copy-pasted schema from another table.

Related errors


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