apache/seatunnel · error · org.apache.seatunnel.common.exception.SeaTunnelRuntimeException

COMMON-17

COMMON-17

Error message

'<identifier>' unsupported convert type '<dataType>' of '<field>' to SeaTunnel data type.

What it means

TiDB JDBC catalog failed to map a TiDB (MySQL-protocol) column type to a SeaTunnel data type. TiDBDataTypeConvertor.toSeaTunnelType delegates to the MySQL convertor; if that throws CONVERT_TO_SEATUNNEL_TYPE_ERROR_SIMPLE it is re-wrapped as a TiDB-specific CommonError with the dialect name, the MySQL type name, and the field.

Solutions

  1. Alter the table column to a supported type or exclude/cast the unsupported column in the source query
  2. Upgrade SeaTunnel to a version whose MySQL/TiDB convertor supports the type
  3. Contribute/extend MysqlTypeConvertor's mapping to add the missing MysqlType

Example fix

// before
CREATE TABLE t (g GEOMETRY);
// after
CREATE TABLE t (g STRING); -- or select CONVERT(g, CHAR) instead of the raw column
Defensive patterns

Strategy: validation

Validate before calling

for (Column col : tableColumns) {
    MysqlType mt = MysqlType.getByName(col.getTypeName());
    if (!SUPPORTED.contains(mt)) {
        log.warn("TiDB column {} has unsupported type {} - cast or exclude it", col.getName(), mt);
    }
}

Try / catch

try {
    return tidbConvertor.toSeaTunnelType(field, mysqlType, props);
} catch (SeaTunnelRuntimeException e) {
    if (CommonErrorCode.CONVERT_TO_SEATUNNEL_TYPE_ERROR_SIMPLE.equals(e.getSeaTunnelErrorCode())) {
        log.warn("Unsupported TiDB type {} for field {}; excluding column", mysqlType, field);
        return null;
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling TiDBDataTypeConvertor.toSeaTunnelType(field, mysqlType, dataTypeProperties) with a MysqlType that the underlying MySQL convertor does not support (e.g. exotic or newer MySQL types like BIT, GEOMETRY, JSON depending on version).

Common situations: Reading TiDB tables with columns of unsupported MySQL types (geometry, bit, enums/sets in some versions); schema discovery during catalog read; TiDB version introducing column types not yet handled.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/6572042da7ff4f60. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/tidb/TiDBDataTypeConvertor.java:95

                break;
            default:
                dataTypeProperties = Collections.emptyMap();
                break;
        }
        return toSeaTunnelType(field, mysqlType, dataTypeProperties);
    }

    // todo: It's better to wrapper MysqlType to a pojo in ST, since MysqlType doesn't contains
    // properties.
    @Override
    public SeaTunnelDataType<?> toSeaTunnelType(
            String field, MysqlType mysqlType, Map<String, Object> dataTypeProperties) {
        try {
            return MYSQL_CONVERTOR.toSeaTunnelType(field, mysqlType, dataTypeProperties);
        } catch (SeaTunnelRuntimeException e) {
            if (CommonErrorCode.CONVERT_TO_SEATUNNEL_TYPE_ERROR_SIMPLE.equals(
                    e.getSeaTunnelErrorCode())) {
                throw CommonError.convertToSeaTunnelTypeError(
                        DatabaseIdentifier.TIDB, mysqlType.getName(), field);
            }
            throw e;
        }
    }

    @Override
    public MysqlType toConnectorType(
            String field,
            SeaTunnelDataType<?> seaTunnelDataType,
            Map<String, Object> dataTypeProperties) {
        try {
            return MYSQL_CONVERTOR.toConnectorType(field, seaTunnelDataType, dataTypeProperties);
        } catch (SeaTunnelRuntimeException e) {
            if (CommonErrorCode.CONVERT_TO_CONNECTOR_TYPE_ERROR_SIMPLE.equals(
                    e.getSeaTunnelErrorCode())) {
                throw CommonError.convertToConnectorTypeError(
                        DatabaseIdentifier.TIDB, seaTunnelDataType.getSqlType().name(), field);

View on GitHub (pinned to cf67b549a7)