apache/seatunnel · error · InfluxdbConnectorException

UNSUPPORTED_DATA_TYPE

UNSUPPORTED_DATA_TYPE

Error message

Unsupported data type: 

What it means

DefaultSerializer.createFieldExtractor builds a per-field extractor that writes SeaTunnel row values into InfluxDB Point fields. Its switch over the field's SeaTunnelDataType handles only the numeric and STRING cases; any other data type hits the default branch and throws InfluxdbConnectorException with code UNSUPPORTED_DATA_TYPE naming the dataType.

Source

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

                        break;
                    case INT:
                        builder.addField(field, ((Number) val).intValue());
                        break;
                    case BIGINT:
                        // Only timstamp support be bigint,however it is processed in specicalField
                        builder.addField(field, ((Number) val).longValue());
                        break;
                    case FLOAT:
                        builder.addField(field, ((Number) val).floatValue());
                        break;
                    case DOUBLE:
                        builder.addField(field, ((Number) val).doubleValue());
                        break;
                    case STRING:
                        builder.addField(field, val.toString());
                        break;
                    default:
                        throw new InfluxdbConnectorException(
                                CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,
                                "Unsupported data type: " + dataType);
                }
            }
        };
    }

    private BiConsumer<SeaTunnelRow, Point.Builder> createTimestampExtractor(
            SeaTunnelRowType seaTunnelRowType, String timeKey) {
        // not config timeKey, use processing time
        if (Strings.isNullOrEmpty(timeKey)) {
            return (row, builder) -> builder.time(System.currentTimeMillis(), precision);
        }

        int timeFieldIndex = seaTunnelRowType.indexOf(timeKey);
        return (row, builder) -> {
            Object time = row.getField(timeFieldIndex);
            if (time == null) {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Cast unsupported fields to supported types in an upstream SQL/transform step (e.g. BOOLEAN to INT, DATE to STRING or BIGINT epoch)
  2. Align the sink schema with supported types: integers, bigints, doubles/floats, strings
  3. Remove or split out non-scalar columns before writing to InfluxDB
  4. If the type should be supported (e.g. BOOLEAN as a field), add a case to the switch that calls builder.addField appropriately

Example fix

// before
schema = { fields = { active = "boolean" } }
// after (cast to supported type upstream via Sql transform)
SQL = "SELECT CAST(active AS INT) AS active FROM src"
Defensive patterns

Strategy: validation

Validate before calling

java.util.Set<SeaTunnelDataType<?>> ok = Set.of(BasicType.INT_TYPE, BasicType.LONG_TYPE,
    BasicType.DOUBLE_TYPE, BasicType.FLOAT_TYPE, BasicType.STRING_TYPE);
sinkSchema.getTableSchema().toPhysicalRowDataType().getFieldTypes()
    .forEach(t -> { if (!ok.contains(t)) throw new IllegalArgumentException("Sink field type unsupported: " + t); });

Type guard

boolean isWritable(SeaTunnelDataType<?> t) {
    return t.equals(BasicType.INT_TYPE) || t.equals(BasicType.LONG_TYPE)
        || t.equals(BasicType.DOUBLE_TYPE) || t.equals(BasicType.FLOAT_TYPE)
        || t.equals(BasicType.STRING_TYPE);
}

Try / catch

try {
    serializer.serialize(row);
} catch (InfluxdbConnectorException e) {
    if (String.valueOf(e.getCode()).contains("UNSUPPORTED_DATA_TYPE")) {
        log.error("Non-numeric/string field in sink schema: {}", e.getMessage());
    }
    throw e;
}

Prevention

When it happens

Trigger: Configuring an InfluxDB sink with a schema field whose SeaTunnelDataType is BOOLEAN, DATE, TIME, ARRAY, MAP, ROW, BYTES, etc. — anything outside the numeric/STRING cases — and writing a row through DefaultSerializer.

Common situations: Sink schema mirrors a complex upstream source (e.g. a JDBC source with DATE/TIMESTAMP columns) and the user didn't cast those columns to supported types; BOOLEAN fields assumed supported but missing from the switch.

Related errors


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