{"record":{"id":"d62bbfe12217ed84","repo":"apache/seatunnel","slug":"common-19-d62bbf","errorCode":"COMMON-19","errorMessage":"'<identifier>' unsupported convert SeaTunnel data type '<dataType>' of '<field>' to connector data type.","messagePattern":"'<identifier>' unsupported convert SeaTunnel data type '<dataType>' of '<field>' to connector 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":519,"sourceCode":"                        timestampTzScale = MAX_TIMESTAMP_SCALE;\n                        log.warn(\n                                \"The timestamp_tz column {} type datetime_tz({}) is out of range, \"\n                                        + \"which exceeds the maximum scale of {}, \"\n                                        + \"it will be converted to datetime_tz({})\",\n                                column.getName(),\n                                column.getScale(),\n                                MAX_TIMESTAMP_SCALE,\n                                timestampTzScale);\n                    }\n                    builder.columnType(\n                            String.format(\"DATETIME(%s) WITH TIME ZONE\", timestampTzScale));\n                    builder.scale(timestampTzScale);\n                } else {\n                    builder.columnType(DM_DATETIME_WITH_TIME_ZONE);\n                }\n                break;\n            default:\n                throw CommonError.convertToConnectorTypeError(\n                        DatabaseIdentifier.DAMENG,\n                        column.getDataType().toString(),\n                        column.getName());\n        }\n        return builder.build();\n    }\n}\n","sourceCodeStart":501,"sourceCodeEnd":527,"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#L501-L527","documentation":"This error is thrown by DmdbTypeConverter.reconvert() when mapping a SeaTunnel data type back to a DM (Dameng) connector column type, typically when the sink creates the target table (auto table creation / schema evolution). Every SeaTunnel type the sink needs to write must have a case in reconvert's switch; unsupported types (e.g. SeaTunnel ARRAY/MAP/ROW composite types, or types the DM dialect has no DDL mapping for) fall through to the default branch and raise this error with the DAMENG identifier, the SeaTunnel type name, and the field name.","triggerScenarios":"Writing to a Dameng database via the JDBC sink with schema_save_mode = CREATE_SCHEMA_WHEN_NOT_EXIST (or a schema evolution mode) when the upstream SeaTunnel schema contains a data type that reconvert() cannot map — most commonly complex types (ARRAY, MAP, ROW/struct) or a source that produced types DM has no direct column type for.","commonSituations":"Chaining a source that emits complex types (e.g. a JSON/Nested source or a transform producing MAP/ARRAY fields) directly into a DM sink with auto table creation enabled. Also seen when the upstream table gained a new column of an unmappable type after the job was configured.","solutions":["Flatten or remove complex fields before the sink: use a transform (e.g. JsonPath/Replace or Filter/Sql transform) to convert ARRAY/MAP/ROW columns into scalar/string columns.","Create the target DM table manually with compatible column types and set schema_save_mode = ERROR_WHEN_SCHEMA_NOT_EXIST (or RECREATE) so reconvert is not asked to map unsupported types.","Cast the field to a supported scalar SeaTunnel type upstream (e.g. serialize nested data to a STRING field).","Upgrade SeaTunnel — DM dialect type coverage expands between releases.","If needed, add a case for the SeaTunnel type in DmdbTypeConverter.reconvert() mapping it to an appropriate DM column type."],"exampleFix":"// before: auto-create table with MAP field -> fails\nsink {\n  Jdbc {\n    url = \"jdbc:dm://host:5236\"\n    schema_save_mode = \"CREATE_SCHEMA_WHEN_NOT_EXIST\"\n  }\n}\n// after: pre-create the DM table and skip auto-creation\nsink {\n  Jdbc {\n    url = \"jdbc:dm://host:5236\"\n    schema_save_mode = \"ERROR_WHEN_SCHEMA_NOT_EXIST\"\n    // DM table created with compatible scalar columns; nested fields serialized to CLOB\n  }\n}","handlingStrategy":"validation","validationCode":"// Before enabling auto table creation on a DM sink, check the SeaTunnel schema types\nCatalogTable table = ...;\nfor (CatalogColumn col : table.getTableSchema().getColumns()) {\n    if (!(col.getDataType() instanceof SeaTunnelPrimitiveType)) {\n        throw new IllegalArgumentException(\n            \"Column \" + col.getName() + \" type \" + col.getDataType()\n            + \" cannot auto-create in DM; flatten or pre-create the table.\");\n    }\n}","typeGuard":"// Java: ensure every field in the SeaTunnel row is a scalar type before the DM sink\nstatic boolean allScalarTypes(CatalogTable t) {\n    return t.getTableSchema().getColumns().stream()\n        .allMatch(c -> c.getDataType() instanceof SeaTunnelPrimitiveType);\n}","tryCatchPattern":"try {\n    sink.write(...);\n} catch (SeaTunnelRuntimeException e) {\n    if (e.getMessage().contains(\"COMMON-19\")) {\n        // pre-create the DM table with explicit column types, or flatten complex fields upstream\n        throw new IllegalArgumentException(\"Create DM table manually or convert complex fields to scalar\", e);\n    }\n    throw e;\n}","preventionTips":["Avoid ARRAY/MAP/ROW fields at the DM sink boundary; serialize them to STRING with a transform.","Pre-create target tables with explicit DDL instead of relying on schema_save_mode auto-creation.","Keep source and sink schemas aligned and re-validate after upstream schema changes."],"tags":["jdbc","dameng","type-conversion","sink","table-creation"],"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"}