apache/seatunnel · error · UnsupportedOperationException

Unsupported data type:

Error message

Unsupported data type: 

What it means

DefaultSerializer.createTimestampExtractor determines the InfluxDB point timestamp for each row. Its switch supports only timestamp-typed and BIGINT fields; any other type for the configured timestamp field hits the default branch and throws UnsupportedOperationException 'Unsupported data type: ' + timestampFieldType. Note this is a plain UnsupportedOperationException, not an InfluxdbConnectorException.

Source

Thrown at seatunnel-connectors-v2/connector-influxdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/influxdb/serialize/DefaultSerializer.java:144

            }
            SeaTunnelDataType<?> timestampFieldType = seaTunnelRowType.getFieldType(timeFieldIndex);
            switch (timestampFieldType.getSqlType()) {
                case STRING:
                    builder.time(Long.parseLong((String) time), precision);
                    break;
                case TIMESTAMP:
                    builder.time(
                            ((LocalDateTime) time)
                                    .atZone(ZoneOffset.UTC)
                                    .toInstant()
                                    .toEpochMilli(),
                            precision);
                    break;
                case BIGINT:
                    builder.time((Long) time, precision);
                    break;
                default:
                    throw new UnsupportedOperationException(
                            "Unsupported data type: " + timestampFieldType);
            }
        };
    }

    private BiConsumer<SeaTunnelRow, Point.Builder> createTagExtractor(
            SeaTunnelRowType seaTunnelRowType, List<String> tagKeys) {
        // not config tagKeys
        if (CollectionUtils.isEmpty(tagKeys)) {
            return (row, builder) -> {};
        }

        return (row, builder) -> {
            for (String tagKey : tagKeys) {
                int indexOfSeaTunnelRow = seaTunnelRowType.indexOf(tagKey);
                builder.tag(tagKey, row.getField(indexOfSeaTunnelRow).toString());
            }
        };

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Declare the timestamp field as BIGINT (epoch) or TIMESTAMP in the sink schema
  2. Cast the source column, e.g. SQL transform 'SELECT CAST(ts AS BIGINT) AS ts FROM src' or convert string datetime to epoch before the sink
  3. Check the sink's timestamp config key points to the intended column
  4. If STRING-epoch support is needed, add a case parsing the value to millis in createTimestampExtractor

Example fix

// before
schema = { fields = { ts = "string" } } // ts used as timestamp
// after
schema = { fields = { ts = "bigint" } } // epoch millis
Defensive patterns

Strategy: validation

Validate before calling

SeaTunnelDataType<?> tsType = schema.getField(timestampField);
if (!(tsType.equals(LocalTimeType.LOCAL_DATE_TIME_TYPE) || tsType.equals(BasicType.LONG_TYPE))) {
    throw new IllegalArgumentException("Timestamp field must be TIMESTAMP or BIGINT, got: " + tsType);
}

Type guard

boolean isValidTimestampField(SeaTunnelDataType<?> t) {
    return t.equals(LocalTimeType.LOCAL_DATE_TIME_TYPE) || t.equals(BasicType.LONG_TYPE);
}

Try / catch

try {
    serializer.serialize(row);
} catch (UnsupportedOperationException e) {
    if (e.getMessage().startsWith("Unsupported data type")) {
        log.error("Timestamp field wrong type: {}", e.getMessage());
    }
    throw e;
}

Prevention

When it happens

Trigger: Configuring the InfluxDB sink's timestamp field to a column whose SeaTunnelDataType is neither TIMESTAMP nor BIGINT — e.g. a STRING datetime, DATE, or an INT where BIGINT was expected — and writing a row.

Common situations: Users point the timestamp config at a string-formatted datetime column; schema changed from BIGINT to another type after a refactor; upstream connector emits DATE where a BIGINT epoch was expected.

Related errors


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