apache/seatunnel · error · EasysearchConnectorException
UNSUPPORTED_DATA_TYPE
UNSUPPORTED_DATA_TYPE
Error message
Unexpected value:
What it means
DefaultSeaTunnelRowDeserializer.convertValue converts an Easysearch string/JSON field value into the target SeaTunnelDataType via an if/else chain over known types (primitives, arrays, maps, byte arrays, VOID/null). If the field's type instance matches none of the branches, it throws UNSUPPORTED_DATA_TYPE 'Unexpected value: <type>'.
Source
Thrown at seatunnel-connectors-v2/connector-easysearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/easysearch/serialize/source/DefaultSeaTunnelRowDeserializer.java:196
MapType<?, ?> mapType = (MapType<?, ?>) fieldType;
SeaTunnelDataType<?> keyType = mapType.getKeyType();
SeaTunnelDataType<?> valueType = mapType.getValueType();
Map<String, String> stringMap =
mapper.readValue(fieldValue, new TypeReference<HashMap<String, String>>() {});
Map<Object, Object> convertMap = new HashMap<Object, Object>();
for (Map.Entry<String, String> entry : stringMap.entrySet()) {
Object convertKey = convertValue(keyType, entry.getKey());
Object convertValue = convertValue(valueType, entry.getValue());
convertMap.put(convertKey, convertValue);
}
return convertMap;
} else if (fieldType instanceof PrimitiveByteArrayType) {
return Base64.getDecoder().decode(fieldValue);
} else if (VOID_TYPE.equals(fieldType) || fieldType == null) {
return null;
} else {
throw new EasysearchConnectorException(
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", " ");
if (fieldValue.length() == "yyyyMMdd".length()
|| fieldValue.length() == "yyyy-MM-dd".length()) {
formatDate = fieldValue + " 00:00:00";
}
DateTimeFormatter dateTimeFormatter = dateTimeFormatterMap.get(formatDate.length());View on GitHub (pinned to cf67b549a7)
Solutions
- Use a supported SeaTunnel type (STRING, INT, BIGINT, BOOLEAN, FLOAT, DOUBLE, DATE, TIME, TIMESTAMP, MAP, ARRAY, BYTES) in the schema.
- Upgrade the connector version if the type you need was recently added to SeaTunnel API.
- As a workaround declare the field as STRING/BYTES and convert downstream.
- Extend convertValue with a branch for the missing SeaTunnelDataType if implementing support.
Example fix
// before SeaTunnelDataType<?> t = new UnknownCustomType(); // after SeaTunnelDataType<?> t = BasicType.STRING_TYPE;
Defensive patterns
Strategy: validation
Validate before calling
// Java: restrict schema to supported types
Set<SeaTunnelDataType<?>> supported = Set.of(BasicType.STRING_TYPE, BasicType.INT_TYPE, BasicType.LONG_TYPE, BasicType.BOOLEAN_TYPE, BasicType.FLOAT_TYPE, BasicType.DOUBLE_TYPE, LocalTimeType.LOCAL_DATE_TYPE, MapType.STRING_MAP_TYPE);
if (!supported.contains(fieldType)) throw new IllegalArgumentException("Type not supported by easysearch deserializer: " + fieldType); Type guard
boolean isSupported(SeaTunnelDataType<?> t) { return t == null || VOID_TYPE.equals(t) || t instanceof BasicType || t instanceof MapType || t instanceof ArrayType || t instanceof PrimitiveByteArrayType; } Prevention
- Only declare well-known SeaTunnel basic/map/array/bytes types in the schema
- Pin connector and SeaTunnel API versions together to avoid type drift
- Declare exotic fields as STRING and convert downstream
When it happens
Trigger: A SeaTunnelDataType that is not in convertValue's chain (e.g. an unusual/custom or newly added SeaTunnel type such as a TimeType variant or a connector-specific type) passed as the target type while deserializing an Easysearch document.
Common situations: Using a newly introduced SeaTunnel data type in the schema with an older easysearch connector; declaring a custom type; typos in mapping config that resolve to an exotic type class.
Related errors
- Unsupported type:
- Unsupported BYTES value type:
- UNSUPPORTED_OPERATION
- UNSUPPORTED_OPERATION
- UNSUPPORTED_DATA_TYPE
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/3e5ea2e9ce97289d.
Report an issue: GitHub.