apache/seatunnel · error · IotdbConnectorException

UNSUPPORTED_DATA_TYPE

UNSUPPORTED_DATA_TYPE

Error message

Unsupported data type: 

What it means

DefaultSeaTunnelRowSerializer.createTimestampExtractor() extracts the record timestamp as epoch millis for IoTDB writes and supports only TIMESTAMP (LocalDateTime) and BIGINT (Long) SeaTunnel types. If the configured timestamp field's SeaTunnel type is anything else, the lambda's default branch throws IotdbConnectorException with CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE. The connector cannot derive epoch-milli time from the declared type.

Source

Thrown at seatunnel-connectors-v2/connector-iotdb-v2/src/main/java/org/apache/seatunnel/connectors/seatunnel/iotdbv2/serialize/DefaultSeaTunnelRowSerializer.java:95

        return row -> {
            Object timestamp = row.getField(timestampFieldIndex);
            if (timestamp == null) {
                return System.currentTimeMillis();
            }
            SeaTunnelDataType<?> timestampFieldType =
                    seaTunnelRowType.getFieldType(timestampFieldIndex);
            switch (timestampFieldType.getSqlType()) {
                case STRING:
                    return Long.parseLong((String) timestamp);
                case TIMESTAMP:
                    return ((LocalDateTime) timestamp)
                            .atZone(ZoneOffset.UTC)
                            .toInstant()
                            .toEpochMilli();
                case BIGINT:
                    return (Long) timestamp;
                default:
                    throw new IotdbConnectorException(
                            CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,
                            "Unsupported data type: " + timestampFieldType);
            }
        };
    }

    private Function<SeaTunnelRow, String> createDeviceExtractor(
            SeaTunnelRowType seaTunnelRowType, String deviceKey, String storageGroup) {
        int deviceIndex = seaTunnelRowType.indexOf(deviceKey);
        return seaTunnelRow -> {
            String device = seaTunnelRow.getField(deviceIndex).toString();
            if (Strings.isNullOrEmpty(storageGroup)) {
                return device;
            }
            if (storageGroup.endsWith(".") || device.startsWith(".")) {
                return storageGroup + device;
            }
            return storageGroup + "." + device;

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set the timestamp field's SeaTunnel type to TIMESTAMP (LocalDateTime) or BIGINT (Long) in the sink schema/options
  2. If upstream provides a STRING or INT time, convert it in a Transform before the IoTDB sink (e.g. CAST to BIGINT/TIMESTAMP)
  3. Verify the timestamp_data_type option value matches the actual upstream field type
  4. Upgrade the connector to check whether additional timestamp types are supported

Example fix

// before
timestamp_field = "ts"
timestamp_data_type = "string"
// after
timestamp_field = "ts"
timestamp_data_type = "bigint" // or "timestamp"
Defensive patterns

Strategy: validation

Validate before calling

SqlType s = timestampFieldType.getSqlType();
if (s != SqlType.TIMESTAMP && s != SqlType.BIGINT) {
    throw new IllegalArgumentException(
        "IoTDB sink timestamp field must be TIMESTAMP or BIGINT, got: " + s);
}

Type guard

boolean validTimestampField(SeaTunnelFieldType t) {
    return t.getSqlType() == SqlType.TIMESTAMP || t.getSqlType() == SqlType.BIGINT;
}

Try / catch

try {
    serializer = new DefaultSeaTunnelRowSerializer(...);
} catch (IotdbConnectorException e) {
    if (String.valueOf(e).contains("Unsupported data type")) {
        // fix timestamp_data_type to bigint or timestamp
    }
    throw e;
}

Prevention

When it happens

Trigger: Writing to IoTDB (non-relational serializer) when the configured timestamp field type is neither TIMESTAMP nor BIGINT — e.g. INT, STRING, DATE. Triggered at serializer construction (called from DefaultSeaTunnelRowSerializer), typically during sink open/prepare when the timestamp extractor is created.

Common situations: Configuring timestamp field with timestamp_data_type=STRING or INT while the data actually holds epoch millis; schema mismatch between the upstream source and the IoTDB sink's declared timestamp type; copy-pasted config from a version where different types were accepted.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


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