{"record":{"id":"1d08755b1c2d2c13","repo":"apache/seatunnel","slug":"common-17-1d0875","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/dm/DmdbTypeConverter.java","lineNumber":320,"sourceCode":"                    builder.sourceType(DM_DATETIME);\n                } else {\n                    builder.sourceType(String.format(\"%s(%s)\", DM_DATETIME, typeDefine.getScale()));\n                }\n                builder.dataType(LocalTimeType.LOCAL_DATE_TIME_TYPE);\n                builder.scale(typeDefine.getScale());\n                break;\n            case DM_DATETIME_WITH_TIME_ZONE:\n                if (typeDefine.getScale() == null) {\n                    builder.sourceType(DM_DATETIME_WITH_TIME_ZONE);\n                } else {\n                    builder.sourceType(\n                            String.format(\"DATETIME(%s) WITH TIME ZONE\", typeDefine.getScale()));\n                }\n                builder.dataType(LocalTimeType.OFFSET_DATE_TIME_TYPE);\n                builder.scale(typeDefine.getScale());\n                break;\n            default:\n                throw CommonError.convertToSeaTunnelTypeError(\n                        DatabaseIdentifier.DAMENG, typeDefine.getDataType(), typeDefine.getName());\n        }\n        return builder.build();\n    }\n\n    @Override\n    public BasicTypeDefine reconvert(Column column) {\n        BasicTypeDefine.BasicTypeDefineBuilder builder =\n                BasicTypeDefine.builder()\n                        .name(column.getName())\n                        .nullable(column.isNullable())\n                        .comment(column.getComment())\n                        .defaultValue(column.getDefaultValue());\n        switch (column.getDataType().getSqlType()) {\n            case BOOLEAN:\n                builder.columnType(DM_BIT);\n                builder.dataType(DM_BIT);\n                break;","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/dm/DmdbTypeConverter.java#L302-L338","documentation":"This error is thrown by DmdbTypeConverter.convert() when mapping a DM (Dameng) database column type to a SeaTunnel data type. The converter resolves each known DM JDBC type in a switch statement; if the column's reported type is not one of the supported cases (BIT, TINYINT, BYTE, ints, DECIMAL, VARCHAR, DATETIME variants, etc.), control reaches the default branch and CommonError.convertToSeaTunnelTypeError is raised. It carries the database identifier (DAMENG), the raw DM type name, and the column name so the user can identify the offending column.","triggerScenarios":"Reading from a Dameng database via the JDBC source when the table contains a column whose DM type is not handled by DmdbTypeConverter's switch — e.g. spatial/geometry types, BLOB/CLOB large-object types, custom user-defined types, or newer DM type codes introduced in a DM server version newer than the connector supports. Occurs during schema/catalog resolution (catalog table lookup or split enumeration) before any data is read.","commonSituations":"Syncing a DM table that includes TIMESTAMP WITH TIME ZONE variants beyond the handled DATETIME WITH TIME ZONE forms, or GIS/TEXT/IMAGE columns. Also common after upgrading the DM server, where new built-in type codes appear that the pinned connector version's dialect does not recognize.","solutions":["Identify the offending column from the error message ('<field>') and exclude it from the sync (e.g. use column_list / query to select only supported columns, or cast it in a SQL query: SELECT CAST(col AS VARCHAR) ...).","Cast unsupported columns to a supported DM type in your source SQL so the mapper resolves them (e.g. cast spatial types to VARCHAR, LOBs to VARCHAR/BINARY equivalents the dialect handles).","Upgrade SeaTunnel to the latest version — the DM dialect gains new type mappings over time.","If the type must be synced natively, extend DmdbTypeConverter: add a case for the DM type in the switch and map it to the appropriate SeaTunnel type, then contribute the change upstream."],"exampleFix":"// before: table has unsupported column\nsource {\n  Jdbc {\n    url = \"jdbc:dm://host:5236\"\n    table_path = \"schema.table\"  // contains GEOMETRY col\n  }\n}\n// after: select/cast only supported columns\nsource {\n  Jdbc {\n    url = \"jdbc:dm://host:5236\"\n    query = \"SELECT id, name, CAST(geom AS VARCHAR) AS geom FROM schema.table\"\n  }\n}","handlingStrategy":"validation","validationCode":"// Before running the sync, inspect the DM table schema and check each column type\n// against the types DmdbTypeConverter supports (numeric, VARCHAR, DATETIME variants...).\ntry (ResultSet rs = stmt.executeQuery(\n        \"SELECT COLUMN_NAME, DATA_TYPE FROM ALL_TAB_COLUMNS WHERE TABLE_NAME = 'MY_TABLE'\")) {\n    Set<String> supported = Set.of(\"BIT\",\"TINYINT\",\"SMALLINT\",\"INT\",\"BIGINT\",\"DECIMAL\",\n            \"CHAR\",\"VARCHAR\",\"DATE\",\"TIME\",\"DATETIME\",\"TIMESTAMP\");\n    while (rs.next()) {\n        String t = rs.getString(\"DATA_TYPE\").toUpperCase();\n        if (!supported.contains(t))\n            throw new IllegalStateException(\"Unsupported DM column \" + rs.getString(\"COLUMN_NAME\") + \" type \" + t);\n    }\n}","typeGuard":"// Java: guard the column type before conversion\nstatic boolean isSupportedDmType(String dmType) {\n    return dmType != null && SUPPORTED_DM_TYPES.contains(dmType.trim().toUpperCase());\n}","tryCatchPattern":"try {\n    catalogTable = source.getCatalogTable();\n} catch (SeaTunnelRuntimeException e) {\n    if (e.getMessage().contains(\"COMMON-17\")) {\n        // log offending field name from message, fall back to explicit column list / cast query\n        throw new IllegalArgumentException(\"Exclude or cast the unsupported DM column reported by COMMON-17\", e);\n    }\n    throw e;\n}","preventionTips":["Audit the DM table schema (ALL_TAB_COLUMNS) before configuring the source and avoid GEOMETRY/LOB/custom-type columns.","Prefer an explicit query with CASTs for edge-case columns rather than SELECT *.","Test schema resolution on a copy of the table before production sync.","Keep the connector upgraded so newly supported DM types are picked up."],"tags":["jdbc","dameng","type-conversion","unsupported-type"],"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"}