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

Thrown by OceanBaseMySqlTypeConverter.convert() when an OceanBase (MySQL mode) column type has no mapping to a SeaTunnel data type. The converter handles standard MySQL types plus OceanBase vector types (e.g. VECTOR<FLOAT> parsed from the column string); the default branch fires for anything unrecognized. Schema conversion of the OceanBase source fails before reading data.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/oceanbase/OceanBaseMySqlTypeConverter.java:313

                builder.scale(typeDefine.getScale());
                break;
            case MYSQL_TIMESTAMP:
                builder.dataType(LocalTimeType.OFFSET_DATE_TIME_TYPE);
                builder.scale(typeDefine.getScale());
                break;
            case VECTOR_NAME:
                String columnType = typeDefine.getColumnType().toUpperCase();
                if (columnType.startsWith("VECTOR(") && columnType.endsWith(")")) {
                    Integer number =
                            Integer.parseInt(
                                    columnType.substring(
                                            columnType.indexOf("(") + 1, columnType.indexOf(")")));
                    builder.dataType(VectorType.VECTOR_FLOAT_TYPE);
                    builder.scale(number);
                }
                break;
            default:
                throw CommonError.convertToSeaTunnelTypeError(
                        DatabaseIdentifier.OCEANBASE, mysqlDataType, typeDefine.getName());
        }
        return builder.build();
    }

    @Override
    public BasicTypeDefine<OceanBaseMysqlType> reconvert(Column column) {
        BasicTypeDefine.BasicTypeDefineBuilder builder =
                BasicTypeDefine.<OceanBaseMysqlType>builder()
                        .name(column.getName())
                        .nullable(column.isNullable())
                        .comment(column.getComment())
                        .defaultValue(column.getDefaultValue());
        switch (column.getDataType().getSqlType()) {
            case NULL:
                builder.nativeType(OceanBaseMysqlType.NULL);
                builder.columnType(MYSQL_NULL);
                builder.dataType(MYSQL_NULL);

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Identify the failing column from '<field>'/'<dataType>' in the message.
  2. Project only supported columns or cast the column (CAST(col AS CHAR) / vec_to_text for vectors) in a custom query.
  3. Restrict auto schema discovery to tables with fully supported types; split out tables with exotic columns.
  4. Upgrade SeaTunnel for extended OceanBase vector/type support, or add a mapping case in OceanBaseMySqlTypeConverter.convert().

Example fix

// before
SELECT * FROM embeddings; -- VECTOR<f64> unsupported
// after
SELECT id, vec_to_text(v) AS v FROM embeddings;
Defensive patterns

Strategy: validation

Validate before calling

// Pre-validate OceanBase columns against the dialect converter
for (BasicTypeDefine c : obTableColumns) {
    try { new OceanBaseMySqlTypeConverter().convert(c); }
    catch (SeaTunnelRuntimeException e) {
        throw new IllegalStateException("Unsupported OceanBase type " + c.getDataType() + " on " + c.getName());
    }
}

Type guard

boolean isOceanBaseTypeSupported(BasicTypeDefine td) {
    try { new OceanBaseMySqlTypeConverter().convert(td); return true; }
    catch (SeaTunnelRuntimeException e) { return false; }
}

Try / catch

try {
    converter.convert(typeDefine);
} catch (SeaTunnelRuntimeException e) {
    if (e.getMessage().contains("unsupported convert type")) {
        LOG.error("OceanBase column {} type {} unsupported; project/cast it", typeDefine.getName(), typeDefine.getDataType());
    }
    throw e;
}

Prevention

When it happens

Trigger: convert(BasicTypeDefine) on OceanBaseMySqlTypeConverter with a mysqlDataType outside the supported switch at OceanBaseMySqlTypeConverter.java:313 — e.g. OceanBase-proprietary types, unsupported vector element kinds (only VECTOR_FLOAT handled), or spatial/other types not present in the mapping table.

Common situations: Reading OceanBase tables with vector columns of unsupported element type (VECTOR<i8>/VECTOR<f64>), spatial columns, or tenant-mode differences reporting unusual type metadata; OceanBase versions introducing new types not yet in the converter.

Related errors


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