{"record":{"id":"f9d8d7b9fb51f0e1","repo":"apache/seatunnel","slug":"common-19-f9d8d7","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-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/datatypes/StarRocksTypeConverter.java","lineNumber":332,"sourceCode":"            case DATE:\n                builder.columnType(SR_DATE);\n                builder.dataType(SR_DATE);\n                break;\n            case TIMESTAMP:\n                builder.columnType(SR_DATETIME);\n                builder.dataType(SR_DATETIME);\n                break;\n            case TIMESTAMP_TZ:\n                // StarRocks DATETIME does not store timezone info;\n                // TIMESTAMP_TZ (LTZ) is mapped to DATETIME with potential timezone loss.\n                builder.columnType(SR_DATETIME);\n                builder.dataType(SR_DATETIME);\n                break;\n            case MAP:\n                reconvertMap(column, builder);\n                break;\n            default:\n                throw CommonError.convertToConnectorTypeError(\n                        identifier(), column.getDataType().getSqlType().name(), column.getName());\n        }\n\n        return builder.build();\n    }\n\n    private void setDecimalType(\n            PhysicalColumn.PhysicalColumnBuilder builder,\n            BasicTypeDefine<StarRocksType> typeDefine) {\n        Long p = 10L;\n        int scale = 0;\n        if (typeDefine.getPrecision() != null && typeDefine.getPrecision() > 0) {\n            p = typeDefine.getPrecision();\n        }\n\n        if (typeDefine.getScale() != null && typeDefine.getScale() > 0) {\n            scale = typeDefine.getScale();\n        }","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/datatypes/StarRocksTypeConverter.java#L314-L350","documentation":"StarRocksTypeConverter.reconvert() maps a SeaTunnel Column back to a StarRocks column type. Its switch over column.getDataType().getSqlType() covers NULL, BYTES, BOOLEAN, numerics, DATE/DATETIME, MAP, etc.; an unmapped SqlType reaches the default branch and throws this error with the identifier, the SqlType name, and the column name. It is invoked while deriving StarRocks column types for keys and values of MAP columns too (keyColumnType/valueColumnType), so an unsupported map key/value type surfaces here.","triggerScenarios":"Calling reconvert(column) (directly or via reconvertMap -> keyColumnType/valueColumnType) with a column whose SeaTunnel SqlType has no case in the switch — e.g. TIME, TIMESTAMP_TZ variants, ROW, or nested types in positions where they are not allowed (such as a non-primitive MAP key).","commonSituations":"Auto-creating a StarRocks sink table from an upstream schema that includes types like TIME or nested ROW; a MAP column whose key type is not a supported primitive, so reconvert of the key fails; newer SeaTunnel SQL types (e.g. timestamp-with-local-time-zone) not yet mapped.","solutions":["Identify the failing column from the error message and cast it to a supported SeaTunnel type (STRING/BIGINT/DECIMAL/DATE/TIMESTAMP...) before the sink.","For MAP columns, ensure keys are simple primitives (STRING/INT/BIGINT) and values are supported types; flatten or stringify complex values.","Use sink auto-create=false with a pre-created StarRocks table matching a convertible schema.","Extend the switch in reconvert() with the missing SqlType mapping if the type should be supported."],"exampleFix":"// before\nMapColumn(key: ROW(...), value: STRING) -> reconvert -> throws\n// after\nMapColumn(key: STRING, value: STRING) or stringify the key before the sink","handlingStrategy":"validation","validationCode":"// before auto-creating a StarRocks table, check each column's SqlType is handled by reconvert()\njava.util.Set<SqlType> reconvertible = java.util.Set.of(\n    SqlType.NULL, SqlType.BYTES, SqlType.BOOLEAN, SqlType.TINYINT, SqlType.SMALLINT,\n    SqlType.INT, SqlType.BIGINT, SqlType.FLOAT, SqlType.DOUBLE, SqlType.DECIMAL,\n    SqlType.STRING, SqlType.DATE, SqlType.TIMESTAMP, SqlType.MAP, SqlType.ARRAY);\nfor (Column c : rowType.getColumns()) {\n    SqlType st = c.getDataType().getSqlType();\n    if (!reconvertible.contains(st))\n        throw new IllegalStateException(\"Column \" + c.getName() + \" SqlType \" + st + \" not supported for StarRocks DDL\");\n    if (st == SqlType.MAP) {\n        MapType<?, ?> mt = (MapType<?, ?>) c.getDataType();\n        // keys must be simple primitives\n        if (!java.util.Set.of(SqlType.STRING, SqlType.INT, SqlType.BIGINT).contains(mt.getKeyType().getSqlType()))\n            throw new IllegalStateException(\"Unsupported MAP key type for \" + c.getName());\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    StarRocksTypeConverter.INSTANCE.reconvert(column);\n} catch (Exception e) {\n    LOG.error(\"Column {} (SqlType {}) cannot map to StarRocks type; cast before sink\", column.getName(), column.getDataType().getSqlType(), e);\n    throw e;\n}","preventionTips":["Keep MAP keys as STRING/INT/BIGINT primitives","Avoid TIME and nested ROW/ARRAY/MAP columns when targeting StarRocks auto table creation","Serialize complex types to JSON STRING columns before the sink","Test schema translation on a sample table before enabling auto-create in production"],"tags":["starrocks","type-conversion","schema","sink"],"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"}