apache/seatunnel · error · JdbcConnectorException
CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE
CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE
Error message
Unexpected value: ${seaTunnelDataType} What it means
OceanBaseMysqlJdbcRowConverter.toExternal maps SeaTunnel field types to JDBC statement setters. MAP and ROW types (and any other unrecognized type hitting the default branch) have no supported JDBC mapping here, so it throws JdbcConnectorException with UNSUPPORTED_DATA_TYPE naming the offending SeaTunnelDataType.
Source
Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/oceanbase/OceanBaseMysqlJdbcRowConverter.java:266
Object[] array = (Object[]) row.getField(fieldIndex);
if (array == null) {
statement.setNull(statementIndex, java.sql.Types.ARRAY);
break;
}
if (SqlType.TINYINT.equals(elementType.getSqlType())) {
Short[] shortArray = new Short[array.length];
for (int i = 0; i < array.length; i++) {
shortArray[i] = Short.valueOf(array[i].toString());
}
statement.setObject(statementIndex, shortArray);
} else {
statement.setObject(statementIndex, array);
}
break;
case MAP:
case ROW:
default:
throw new JdbcConnectorException(
CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,
"Unexpected value: " + seaTunnelDataType);
}
} catch (Exception e) {
throw new JdbcConnectorException(
JdbcConnectorErrorCode.DATA_TYPE_CAST_FAILED,
"error field:" + rowType.getFieldNames()[fieldIndex],
e);
}
}
return statement;
}
}
View on GitHub (pinned to cf67b549a7)
Solutions
- Flatten nested MAP/ROW fields into primitive columns in a transform before the sink.
- Serialize MAP/ROW to a JSON string column and write that instead.
- Change the catalog schema so the field type is a supported scalar (string, int, decimal, etc.).
- Upgrade the connector in case newer versions added handling for these types.
Example fix
// before sink fields: id:INT, props:MAP<STRING,STRING> // after use SqlTransform to flatten or: props_json = props -> cast to STRING (JSON) so sink field is id:INT, props_json:STRING
Defensive patterns
Strategy: validation
Validate before calling
// Before sink, check schema for nested types
for (SeaTunnelDataType<?> t : rowType.getFieldTypes()) {
if (t.getSqlType() == SqlType.MAP || t.getSqlType() == SqlType.ROW)
throw new IllegalArgumentException("Flatten MAP/ROW fields before OceanBase sink: " + t);
} Type guard
// Java guard
static boolean isFlat(CatalogTable table) {
return table.getTableSchema().toSeaTunnelRowType().getFieldTypes().stream()
.noneMatch(t -> t.getSqlType() == SqlType.MAP || t.getSqlType() == SqlType.ROW);
} Try / catch
catch (JdbcConnectorException e) { if (e.getSeaTunnelApiErrorCode() == CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE) { /* flatten schema or serialize nested field to JSON string */ } } Prevention
- Flatten or JSON-serialize nested MAP/ROW fields before JDBC sinks
- Keep sink catalog schema aligned with flattened source schema
- Check connector docs for supported SeaTunnel SQL types per dialect
When it happens
Trigger: Writing a row whose field is of SeaTunnel type MAP or ROW (or any type falling through the switch default) to an OceanBase MySQL-mode table via this row converter.
Common situations: Sourcing from a nested-data system (e.g. JSON/document source) and sinking directly to OceanBase without flattening; schema evolution introduced nested columns; a type added upstream that this converter version does not handle.
Related errors
- UNSUPPORTED_DATA_TYPE
- Unsupported to derive Schema for type: ${dataType}
- Avro format doesn't support non-string as key type of map. T
- UNSUPPORTED_DATA_TYPE
- Unsupported type:
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/d3b59f64455f016f.
Report an issue: GitHub.