apache/seatunnel · error · ElasticsearchConnectorException
COMMON_UNSUPPORTED_DATA_TYPE
COMMON_UNSUPPORTED_DATA_TYPE
Error message
Unexpected value:
What it means
convertValue handles a fixed set of SeaTunnel field types when deserializing ES documents. If the field's SeaTunnelDataType is none of the supported types (and not VOID or null), it throws ElasticsearchConnectorException with UNSUPPORTED_DATA_TYPE: 'Unexpected value: ' + the type.
Source
Thrown at seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/serialize/source/DefaultSeaTunnelRowDeserializer.java:239
String fieldName = rowType.getFieldName(i);
SeaTunnelDataType<?> fieldDataType = rowType.getFieldType(i);
Object value = collect.get(fieldName);
if (value != null) {
seaTunnelFields[i] =
convertValue(
fieldDataType,
(value instanceof List || value instanceof Map)
? mapper.writeValueAsString(value)
: value.toString());
}
}
return new SeaTunnelRow(seaTunnelFields);
} else if (fieldType instanceof PrimitiveByteArrayType) {
return Base64.getDecoder().decode(fieldValue);
} else if (VOID_TYPE.equals(fieldType) || fieldType == null) {
return null;
} else {
throw new ElasticsearchConnectorException(
CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,
"Unexpected value: " + fieldType);
}
}
}
private LocalDateTime parseDate(String fieldValue) {
// handle strings of timestamp type
try {
long ts = Long.parseLong(fieldValue);
return LocalDateTime.ofInstant(Instant.ofEpochMilli(ts), ZoneId.systemDefault());
} catch (NumberFormatException e) {
// no op
}
String formatDate = fieldValue.replace("T", " ").replace("Z", "");
if (fieldValue.length() == "yyyyMMdd".length()
|| fieldValue.length() == "yyyy-MM-dd".length()) {
formatDate = fieldValue + " 00:00:00";View on GitHub (pinned to cf67b549a7)
Solutions
- Change the column type in the SeaTunnel schema to a supported type (string, boolean, byte, short, int, long, float, double, date, time, timestamp, bytes, or row as handled)
- Convert unsupported types to strings/structs upstream before the ES sink
- Upgrade the connector to a version with wider type support
Example fix
// before field my_map MAP<STRING,STRING> // after field my_map STRING // JSON-serialize map upstream, or use a supported type
Defensive patterns
Strategy: type-guard
Validate before calling
Set<SqlType> supported = Set.of(STRING, BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, DATE, TIME, TIMESTAMP, BYTES, ROW);
rowType.getFieldTypes().forEach(t -> {
if (!supported.contains(t.getSqlType()) && !(t instanceof PrimitiveByteArrayType))
throw new IllegalArgumentException("Unsupported ES deserializer type: " + t);
}); Type guard
boolean isSupportedFieldType(SeaTunnelDataType<?> t) {
return t instanceof BasicType || t instanceof LocalTimeType || t instanceof PrimitiveByteArrayType || t instanceof SeaTunnelRowType || VOID_TYPE.equals(t);
} Prevention
- Use only basic/date/time/bytes/row types in ES source schemas
- Convert complex types to STRING upstream
- Check the deserializer's supported type list when designing schemas
When it happens
Trigger: A source table field whose type maps to a SeaTunnelDataType not covered by the if/else chain in DefaultSeaTunnelRowDeserializer.convertValue (e.g. an array/map/row type the deserializer does not handle).
Common situations: Schema evolution added a complex column type; connector version lacks support for the type; users declare exotic types in source config read from ES.
Related errors
- Unable to convert to LocalDateTime from unexpected value ''
- COMMON_UNSUPPORTED_OPERATION
- READ_FAILED
- UNSUPPORTED_OPERATION
- Unsupported convert %s to Map, typeDefine: %s
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/cca5bb7260777a9d.
Report an issue: GitHub.