{"record":{"id":"4ebc2b30bf74e522","repo":"apache/seatunnel","slug":"common-17-4ebc2b","errorCode":"COMMON-17","errorMessage":"'<identifier>' unsupported convert type '<dataType>' of '<field>' to SeaTunnel data type.","messagePattern":"'<identifier>' unsupported convert type '<dataType>' of '<field>' to SeaTunnel data type\\.","errorType":"error_code","errorClass":"org.apache.seatunnel.common.exception.SeaTunnelRuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/mysql/MySqlTypeConverter.java","lineNumber":329,"sourceCode":"                break;\n            case MYSQL_DATE:\n                builder.dataType(LocalTimeType.LOCAL_DATE_TYPE);\n                break;\n            case MYSQL_TIME:\n                builder.dataType(LocalTimeType.LOCAL_TIME_TYPE);\n                builder.scale(typeDefine.getScale());\n                break;\n            case MYSQL_DATETIME:\n                builder.dataType(LocalTimeType.LOCAL_DATE_TIME_TYPE);\n                builder.scale(typeDefine.getScale());\n                break;\n            case MYSQL_TIMESTAMP:\n                // MySQL TIMESTAMP is LTZ (stored as UTC, displayed in session timezone)\n                builder.dataType(LocalTimeType.OFFSET_DATE_TIME_TYPE);\n                builder.scale(typeDefine.getScale());\n                break;\n            default:\n                throw CommonError.convertToSeaTunnelTypeError(\n                        DatabaseIdentifier.MYSQL, mysqlDataType, typeDefine.getName());\n        }\n        return builder.build();\n    }\n\n    @Override\n    public BasicTypeDefine<MysqlType> reconvert(Column column) {\n        BasicTypeDefine.BasicTypeDefineBuilder builder =\n                BasicTypeDefine.<MysqlType>builder()\n                        .name(column.getName())\n                        .nullable(column.isNullable())\n                        .comment(column.getComment())\n                        .defaultValue(column.getDefaultValue());\n        switch (column.getDataType().getSqlType()) {\n            case NULL:\n                builder.nativeType(MysqlType.NULL);\n                builder.columnType(MYSQL_NULL);\n                builder.dataType(MYSQL_NULL);","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/mysql/MySqlTypeConverter.java#L311-L347","documentation":"Thrown by MySqlTypeConverter.convert() when a MySQL column type has no mapping to a SeaTunnel data type. The converter handles known MySQL types (TIMESTAMP -> OFFSET_DATE_TIME, etc.); the default branch fires for unrecognized or unsupported type strings. This aborts schema conversion of the MySQL source before data reading.","triggerScenarios":"convert(BasicTypeDefine) on MySqlTypeConverter with a mysqlDataType not in the switch at MySqlTypeConverter.java:329 — e.g. GEOMETRY/POINT spatial types, JSON in old connector versions, BIT beyond handled widths, or vendor-extended type names reported by unusual MySQL-compatible databases.","commonSituations":"Reading tables with MySQL spatial (GEOMETRY) columns; MySQL-compatible databases (TiDB, Percona variants) reporting nonstandard type names; older MySQL 5.x types or set/enum columns in versions lacking support.","solutions":["Read '<dataType>' from the message to find the unsupported MySQL column and its field name.","Exclude the column via explicit SELECT projection or configure the source to skip that table.","Cast the column in a custom SQL (e.g. ST_AsText(geom) or CAST(col AS CHAR)) so it maps to STRING.","Upgrade SeaTunnel — newer versions add MySQL type mappings (e.g. geometry/vector support).","Add a case in MySqlTypeConverter.convert() and contribute upstream."],"exampleFix":"// before\nSELECT * FROM places; -- GEOMETRY col fails\n// after\nSELECT id, ST_AsText(location) AS location FROM places;","handlingStrategy":"validation","validationCode":"// Validate MySQL source columns are mappable before job start\nfor (BasicTypeDefine c : mysqlTableColumns) {\n    try { new MySqlTypeConverter().convert(c); }\n    catch (SeaTunnelRuntimeException e) {\n        throw new IllegalStateException(\"Unsupported MySQL type \" + c.getDataType() + \" on column \" + c.getName());\n    }\n}","typeGuard":"boolean isMySqlTypeSupported(BasicTypeDefine td) {\n    try { new MySqlTypeConverter().convert(td); return true; }\n    catch (SeaTunnelRuntimeException e) { return false; }\n}","tryCatchPattern":"try {\n    converter.convert(typeDefine);\n} catch (SeaTunnelRuntimeException e) {\n    if (e.getMessage().contains(\"unsupported convert type\")) {\n        LOG.error(\"Exclude/cast column {} ({})\", typeDefine.getName(), typeDefine.getDataType());\n    }\n    throw e;\n}","preventionTips":["Avoid SELECT * on tables with GEOMETRY/JSON/spatial columns unless supported.","Use SQL casts (ST_AsText, CAST AS CHAR) for special columns.","Check MySQL-compatible DB (TiDB, etc.) type metadata for nonstandard names.","Upgrade SeaTunnel to get new MySQL type mappings."],"tags":["jdbc","type-conversion","mysql","schema"],"backgroundTag":"unsupported-dtype","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}