apache/seatunnel · error · EasysearchConnectorException
UNSUPPORTED_OPERATION
UNSUPPORTED_OPERATION
Error message
Unsupported type:
What it means
KeyExtractor.createFieldFormatter builds per-field serializers for converting SeaTunnelRow data into Easysearch bulk documents. It explicitly rejects ROW, ARRAY, and MAP SQL types because the Easysearch serializer has no mapping for nested/complex structures. Any source schema containing these types fails fast when the row is serialized for writing.
Source
Thrown at seatunnel-connectors-v2/connector-easysearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/easysearch/serialize/KeyExtractor.java:65
List<FieldFormatter> fieldFormatters = new ArrayList<>(primaryKeys.length);
for (String fieldName : primaryKeys) {
int fieldIndex = rowType.indexOf(fieldName);
SeaTunnelDataType<?> fieldType = rowType.getFieldType(fieldIndex);
FieldFormatter fieldFormatter = createFieldFormatter(fieldIndex, fieldType);
fieldFormatters.add(fieldFormatter);
}
return new KeyExtractor(fieldFormatters.toArray(new FieldFormatter[0]), keyDelimiter);
}
private static FieldFormatter createFieldFormatter(
int fieldIndex, SeaTunnelDataType fieldType) {
return row -> {
switch (fieldType.getSqlType()) {
case ROW:
case ARRAY:
case MAP:
throw new EasysearchConnectorException(
UNSUPPORTED_OPERATION, "Unsupported type: " + fieldType);
case DATE:
LocalDate localDate = (LocalDate) row.getField(fieldIndex);
return localDate.toString();
case TIME:
LocalTime localTime = (LocalTime) row.getField(fieldIndex);
return localTime.toString();
case TIMESTAMP:
LocalDateTime localDateTime = (LocalDateTime) row.getField(fieldIndex);
return localDateTime.toString();
default:
return row.getField(fieldIndex).toString();
}
};
}
@Override
public String apply(SeaTunnelRow row) {View on GitHub (pinned to cf67b549a7)
Solutions
- Flatten nested ROW fields into top-level scalar columns upstream (e.g. in a SQL query or a Transform before the sink).
- Convert ARRAY/MAP columns to a JSON string (CAST to STRING) so the field is serialized as text.
- Exclude the unsupported columns via source projection (query only scalar columns).
- If support is genuinely needed, add ROW/ARRAY/MAP handling in KeyExtractor.createFieldFormatter and file/extend an upstream issue.
Example fix
// before: schema contains Map<String,String> tags column // after: flatten/cast upstream SELECT id, name, CAST(tags AS STRING) AS tags FROM my_table;
Defensive patterns
Strategy: validation
Validate before calling
// Java: check schema before writing
for (SeaTunnelRowType.Field f : rowType.getFields()) {
SqlType t = f.getType().getSqlType();
if (t == SqlType.ROW || t == SqlType.ARRAY || t == SqlType.MAP) {
throw new IllegalArgumentException("Flatten/cast field '" + f.getName() + "' before Easysearch sink");
}
} Try / catch
try { writer.write(row); } catch (EasysearchConnectorException e) { if (e.getSeaTunnelErrorCode() == UNSUPPORTED_OPERATION && e.getMessage().startsWith("Unsupported type:")) { log.error("Flatten unsupported nested field first", e); throw e; } } Prevention
- Project only scalar columns from the source query
- Cast MAP/ARRAY/ROW columns to STRING before the sink
- Validate the row type against the sink's supported types in a pre-flight check
When it happens
Trigger: Writing a SeaTunnelRow whose SeaTunnelDataType has getSqlType() of ROW, ARRAY, or MAP to an Easysearch sink; the exception fires inside the row lambda created by fieldFormatter when that field is formatted.
Common situations: Upstream table has a JSON/nested column mapped to ROW, an array column (e.g. MySQL ARRAY or a LIST type), or a MAP/struct column; schema evolution upstream added a nested field; users copy a catalog config from another sink (e.g. Elasticsearch variants) without flattening.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- Unsupported type in LocalTimeArrayType: ${eleSqlType}
- Unsupported type: ${sqlType}
- Unsupported type: ${clazz}
- array inject error, unsupported data type: " + type
- UNSUPPORTED_TYPE
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/5835c3ab7bdee4ff.
Report an issue: GitHub.