apache/seatunnel · error · JdbcConnectorException
UNSUPPORTED_DATA_TYPE
UNSUPPORTED_DATA_TYPE
Error message
Unexpected value:
What it means
KingbaseJdbcRowConverter.toInternal hits its default switch branch when converting a JDBC value whose SeaTunnel data type is ROW, MAP, ARRAY, or any otherwise-unhandled type. The Kingbase row converter does not implement conversion for composite types, so it throws UNSUPPORTED_DATA_TYPE.
Source
Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/kingbase/KingbaseJdbcRowConverter.java:118
fields[fieldIndex] =
Optional.ofNullable(sqlTimestamp)
.map(Timestamp::toLocalDateTime)
.orElse(null);
break;
case TIMESTAMP_TZ:
fields[fieldIndex] = JdbcFieldTypeUtils.getOffsetDateTime(rs, resultSetIndex);
break;
case BYTES:
fields[fieldIndex] = JdbcFieldTypeUtils.getBytes(rs, resultSetIndex);
break;
case NULL:
fields[fieldIndex] = null;
break;
case ROW:
case MAP:
case ARRAY:
default:
throw new JdbcConnectorException(
CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,
"Unexpected value: " + seaTunnelDataType);
}
}
return new SeaTunnelRow(fields);
}
@Override
public PreparedStatement toExternal(
TableSchema tableSchema,
@Nullable TableSchema databaseTableSchema,
SeaTunnelRow row,
PreparedStatement statement)
throws SQLException {
SeaTunnelRowType rowType = tableSchema.toPhysicalRowDataType();
for (int fieldIndex = 0; fieldIndex < rowType.getTotalFields(); fieldIndex++) {
SeaTunnelDataType<?> seaTunnelDataType = rowType.getFieldType(fieldIndex);
int statementIndex = fieldIndex + 1;View on GitHub (pinned to cf67b549a7)
Solutions
- Exclude complex columns from the configured schema; select only scalar columns.
- Cast the column in the query (e.g. to VARCHAR/TEXT) and read it as a string.
- Implement the missing case in KingbaseJdbcRowConverter.toInternal to support the type.
Example fix
// before columns = ["id", "tags"] // tags is an array column // after columns = ["id", "CAST(tags AS VARCHAR) AS tags"] // read as string
Defensive patterns
Strategy: validation
Validate before calling
// Before the sink/source run, assert no composite columns
boolean hasComplex = schema.getFields().stream()
.anyMatch(f -> f.getDataType() instanceof SeaTunnelRowType
|| f.getDataType() instanceof SeaTunnelMapType
|| f.getDataType() instanceof SeaTunnelArrayType);
if (hasComplex) throw new IllegalArgumentException("Kingbase JDBC converter does not support ROW/MAP/ARRAY columns"); Try / catch
try {
row = converter.toInternal(resultSet);
} catch (JdbcConnectorException e) {
if (e.getCode() == CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE) {
// cast the offending column to VARCHAR in the query and re-read as STRING
}
} Prevention
- Declare only scalar column types in the Kingbase connector schema.
- Cast structured DB columns to VARCHAR/TEXT in the query.
- Check the type mapper output for your table before enabling the connector.
When it happens
Trigger: Reading a Kingbase table whose schema is mapped (via KingbaseTypeMapper) to SeaTunnel ROW, MAP, or ARRAY column types; toInternal's switch on SeaTunnelDataType falls through to default.
Common situations: Tables with structured/complex or array-like columns (e.g. Kingbase JSON/structured columns mapped to complex SeaTunnel types); schema mismatch between the configured schema and the physical table.
Related errors
- 查询数据库是否存在失败:
- UNSUPPORTED_DATA_TYPE
- DATA_TYPE_CAST_FAILED
- CONFIG_VALIDATION_FAILED
- CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/d7ca7e282a3ff621.
Report an issue: GitHub.