{"record":{"id":"33035d70d6e8a3e7","repo":"apache/seatunnel","slug":"common-19-33035d","errorCode":"COMMON-19","errorMessage":"'${identifier}' unsupported convert SeaTunnel data type '${dataType}' of '${field}' to connector data type.","messagePattern":"'(.+?)' unsupported convert SeaTunnel data type '(.+?)' of '(.+?)' to connector data type\\.","errorType":"error_code","errorClass":"SeaTunnelRuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/sqlserver/SqlServerTypeConverter.java","lineNumber":508,"sourceCode":"                        log.warn(\n                                \"The timestamp_tz column {} type datetimeoffset({}) is out of\"\n                                        + \" range, which exceeds the maximum scale of {}, \"\n                                        + \"it will be converted to datetimeoffset({})\",\n                                column.getName(),\n                                column.getScale(),\n                                MAX_TIMESTAMP_SCALE,\n                                timestampTzScale);\n                    }\n                    builder.columnType(\n                            String.format(\"%s(%s)\", SQLSERVER_DATETIMEOFFSET, timestampTzScale));\n                    builder.scale(timestampTzScale);\n                } else {\n                    builder.columnType(SQLSERVER_DATETIMEOFFSET);\n                }\n                builder.dataType(SQLSERVER_DATETIMEOFFSET);\n                break;\n            default:\n                throw CommonError.convertToConnectorTypeError(\n                        DatabaseIdentifier.SQLSERVER,\n                        column.getDataType().getSqlType().name(),\n                        column.getName());\n        }\n        return builder.build();\n    }\n}\n","sourceCodeStart":490,"sourceCodeEnd":516,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/sqlserver/SqlServerTypeConverter.java#L490-L516","documentation":"SqlServerTypeConverter.reconvert() maps a SeaTunnel column type back to a SQL Server column type when writing. SeaTunnel SqlTypes with no case in the switch (e.g. MAP, ARRAY, other unmapped types) hit default and throw CommonError.convertToConnectorTypeError. The sink cannot map that field to a SQL Server column type.","triggerScenarios":"Writing a SeaTunnel schema with an unmapped SqlType (nested/complex types) to SQL Server, especially with auto table creation (schema_save-mode create) enabled.","commonSituations":"Sources producing nested data (JSON-ish MAP/ARRAY columns) piped into SQL Server sink; upstream schema change introduces a type the SQL Server mapping lacks.","solutions":["Flatten/cast complex fields to scalars (STRING/NVARCHAR) with a transform before the sink.","Pre-create the SQL Server table with a compatible schema instead of auto-creation.","Remove the unsupported column from the sink schema.","Add a reconvert case for the SqlType if extending the connector."],"exampleFix":"// before: MAP col sent to SQL Server sink\n// after: serialize to string in transform\nquery = \"SELECT id, attrs_string FROM (SELECT id, CAST(attrs AS STRING) AS attrs_string FROM src)\"","handlingStrategy":"validation","validationCode":"// Reject complex types before SQL Server sink\nfor (Column c : catalogTable.getTableSchema().getColumns()) {\n    SqlType st = c.getDataType().getSqlType();\n    if (st == SqlType.MAP || st == SqlType.ARRAY || st == SqlType.ROW) {\n        throw new IllegalStateException(\"Column \" + c.getName()\n            + \" (\" + st + \") must be cast to a scalar before SQL Server sink\");\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    sinkWriter.write(records);\n} catch (SeaTunnelRuntimeException e) {\n    if (e.getMessage().contains(\"unsupported convert SeaTunnel data type\")) {\n        // insert a transform serializing the offending column to STRING, rerun\n    } else { throw e; }\n}","preventionTips":["Flatten nested data upstream; SQL Server sink accepts only mapped scalar types.","Pre-create SQL Server tables with explicit DDL instead of auto-creation.","Gate upstream schema changes with type-compatibility checks.","Keep a pipeline-level type whitelist matching the converter's switch cases."],"tags":["jdbc","sqlserver","type-conversion","sink","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-14T11:17:12.474Z"}