apache/seatunnel · error · UnsupportedOperationException
Unsupported convert ${value.getClass()} to Row, typeDefine:
Error message
Unsupported convert ${value.getClass()} to Row, typeDefine: ${typeDefine} What it means
convertRow accepts only SeaTunnelRow, Collection, or Map values; any other class reaches the final throw of this UnsupportedOperationException. The message names the offending class and the expected row type. It means the value on the ROW conversion path has an entirely unsupported shape, not merely a wrong field count (that is the size check, error 83).
Source
Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/table/converter/BasicDataConverter.java:236
Object object = iterator.next();
SeaTunnelDataType<?> type = typeDefine.getFieldType(i);
array[i] = convert(type, object);
}
return new SeaTunnelRow(array);
}
if (value instanceof Map) {
Map map = (Map) value;
Object[] array = new Object[typeDefine.getTotalFields()];
for (int i = 0; i < typeDefine.getTotalFields(); i++) {
String key = typeDefine.getFieldName(i);
SeaTunnelDataType<?> type = typeDefine.getFieldType(i);
Object object = map.get(key);
array[i] = convert(type, object);
}
return new SeaTunnelRow(array);
}
throw new UnsupportedOperationException(
"Unsupported convert " + value.getClass() + " to Row, typeDefine: " + typeDefine);
}
default String convertString(T typeDefine, Object value) throws UnsupportedOperationException {
if (value instanceof String) {
return (String) value;
}
if (value instanceof Number) {
return convertString(typeDefine, (Number) value);
}
if (value instanceof byte[]) {
return convertString(typeDefine, (byte[]) value);
}
if (value instanceof Boolean) {
return convertString(typeDefine, (boolean) value);
}
if (value instanceof Date) {
return convertString(typeDefine, (Date) value);View on GitHub (pinned to cf67b549a7)
Solutions
- Deserialize or adapt the value into a java.util.Map keyed by field name, or a List ordered by the row type's fields, before calling convertRow.
- Construct a SeaTunnelRow explicitly: new SeaTunnelRow(new Object[]{...}) and pass that.
- Override convertRow in a converter subclass to handle your POJO type.
- Verify the column SqlType is ROW; if the data is scalar, correct the schema or use the matching convert method (convertString, etc.).
Example fix
// before
converter.convertRow(rowType, column, jsonString);
// after
Map<String, Object> fields = new ObjectMapper().readValue(jsonString, new TypeReference<Map<String, Object>>() {});
converter.convertRow(rowType, column, fields); Defensive patterns
Strategy: type-guard
Validate before calling
if (!(value instanceof SeaTunnelRow) && !(value instanceof Collection) && !(value instanceof Map)) {
throw new IllegalArgumentException("convertRow needs SeaTunnelRow/Collection/Map, got " + value.getClass());
} Type guard
boolean isRowConvertible(Object v) {
return v instanceof SeaTunnelRow || v instanceof Collection || v instanceof Map;
} Try / catch
try {
return converter.convertRow(rowType, column, value);
} catch (UnsupportedOperationException e) {
LOG.warn("Row conversion unsupported for {}: {}", value.getClass(), e.getMessage());
return null;
} Prevention
- Deserialize JSON/struct strings into Map before row conversion.
- Build SeaTunnelRow explicitly for POJO data.
- Route scalar values to the specific convert method matching their SqlType, not convertRow.
- Add type checks at the connector boundary.
When it happens
Trigger: Calling convertRow(...) or convert(...) with a ROW SqlType column while value is a String, POJO, byte[], or other object that is neither SeaTunnelRow, Collection, nor Map.
Common situations: A JSON string was never deserialized; a custom record/struct class from another framework was passed directly; the wrong converter method was chosen for the actual data shape.
Understand the failure class
Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.
Related errors
- Unsupported convert %s to Map, typeDefine: %s
- Unsupported convert %s to Array, typeDefine: %s
- The size of collection is not equal to the size of row type
- Unsupported convert ${value.getClass()} to byte[], typeDefin
- Unsupported convert ${value.getClass()} to byte[]
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/ae9441a4d73c670f.
Report an issue: GitHub.