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
- Cast unsupported fields to supported types in an upstream SQL/transform step (e.g. BOOLEAN to INT, DATE to STRING or BIGINT epoch)
- Align the sink schema with supported types: integers, bigints, doubles/floats, strings
- Remove or split out non-scalar columns before writing to InfluxDB
- 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
- Cast BOOLEAN/DATE/TIME columns to supported types in an upstream Sql transform
- Never pass complex types (arrays/maps/rows) directly to the InfluxDB sink schema
- Validate the sink schema types at config load time
- Review schema after upstream source changes to catch new column types
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
- Unsupported data type:
- array inject error, unsupported data type: " + type
- Failed to convert row to JSON
- UNSUPPORTED_DATA_TYPE
- UNSUPPORTED_DATA_TYPE
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/ea4425ac83dae4f8.
Report an issue: GitHub.