apache/seatunnel · error · TypesenseConnectorException
UNSUPPORTED_OPERATION
UNSUPPORTED_OPERATION
Error message
Unsupported type:
What it means
KeyExtractor.createFieldFormatter builds a per-field formatter that converts a SeaTunnelRow field into a Typesense-compatible value. Structured SeaTunnel SQL types (ROW, ARRAY, MAP) have no formatter, so encountering one immediately throws TypesenseConnectorException(UNSUPPORTED_OPERATION, "Unsupported type: " + fieldType).
Source
Thrown at seatunnel-connectors-v2/connector-typesense/src/main/java/org/apache/seatunnel/connectors/seatunnel/typesense/serialize/KeyExtractor.java:77
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 TypesenseConnectorException(
CommonErrorCodeDeprecated.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();
}
};
}
private interface FieldFormatter extends Serializable {View on GitHub (pinned to cf67b549a7)
Solutions
- Flatten nested fields before the Typesense sink (use a transform to extract scalar fields from the row/array/map).
- Change the source schema projection to select only primitive-typed columns.
- If nested data is required, serialize it to a string yourself before it reaches the sink.
Example fix
// before (schema with nested field) rowType = "name STRING, tags ARRAY<STRING>"; // after (flattened for Typesense) rowType = "name STRING, tags STRING"; // join/serialize tags to CSV or JSON string upstream
Defensive patterns
Strategy: validation
Validate before calling
// reject unsupported field types before writing to Typesense
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 field: " + f.getName());
}
} Prevention
- Design the Typesense schema with only scalar fields.
- Flatten ROW/ARRAY/MAP columns with a transform before the sink.
- Serialize nested structures to strings upstream if nesting is unavoidable.
When it happens
Trigger: Typesense row serialization encounters a field whose SeaTunnelDataType has SqlType ROW, ARRAY, or MAP — e.g. the source schema declares a nested struct, array, or map column while writing to a Typesense sink.
Common situations: Reading from databases/sources that produce nested JSON columns, array columns (e.g. PostgreSQL arrays), or map columns and writing to Typesense without flattening the schema first.
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}
- Unsupported type:
- Unsupported SQL type:
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/fea95071a8b2a219.
Report an issue: GitHub.