{"record":{"id":"268aad13175fdaba","repo":"apache/seatunnel","slug":"unsupported-seatunnel-s-data-type-datatype","errorCode":null,"errorMessage":"Unsupported SeaTunnel's data type: \" + dataType","messagePattern":"Unsupported SeaTunnel's data type: \" \\+ dataType","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/sink/StarRocksSaveModeUtil.java","lineNumber":175,"sourceCode":"            case DATE:\n                return \"DATE\";\n            case TIMESTAMP:\n                return \"DATETIME\";\n            case ARRAY:\n                return \"ARRAY<\"\n                        + dataTypeToStarrocksType(\n                                ((ArrayType<?, ?>) dataType).getElementType(), Long.MAX_VALUE)\n                        + \">\";\n            case DECIMAL:\n                DecimalType decimalType = (DecimalType) dataType;\n                return String.format(\n                        \"Decimal(%d, %d)\", decimalType.getPrecision(), decimalType.getScale());\n            case MAP:\n            case ROW:\n                return \"JSON\";\n            default:\n        }\n        throw new IllegalArgumentException(\"Unsupported SeaTunnel's data type: \" + dataType);\n    }\n}\n","sourceCodeStart":157,"sourceCodeEnd":178,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/sink/StarRocksSaveModeUtil.java#L157-L178","documentation":"StarRocksSaveModeUtil.dataTypeToStarrocksType maps SeaTunnel column types to StarRocks SQL types when auto-creating tables. The mapping covers primitives, arrays, DecimalType and MAP/ROW (mapped to JSON); any other SeaTunnelDataType falls into the default branch and throws IllegalArgumentException. It indicates the sink cannot translate the column's type to a StarRocks equivalent.","triggerScenarios":"Calling dataTypeToStarrocksType (via columnToConnectorType during save-mode table creation) with a SeaTunnel column whose SqlType is not covered by the switch — e.g. a newly added or less common type like TIME or NULL_TYPE reaching the default branch.","commonSituations":"Source schema auto-discovery produces a type (e.g. TIME, unknown vendor type) that the StarRocks sink type-mapping has no case for; new SeaTunnel version introduced a type not yet supported by this mapping; custom DataType used programmatically.","solutions":["Cast or transform the offending column upstream (e.g. with a SQL transform CAST to STRING) so it maps to a supported type.","Check the switch in dataTypeToStarrocksType for the supported set and upgrade SeaTunnel if a newer version added the missing mapping.","Define the target table schema explicitly in save-mode (schema_save_mode = CREATE_SCHEMA_WHEN_TABLE_NOT_EXIST with explicit columns) instead of relying on automatic type translation."],"exampleFix":"// before\nTransform\\#sql \"SELECT my_time_col FROM src\"\n// after\nTransform\\#sql \"SELECT CAST(my_time_col AS STRING) AS my_time_col FROM src\"","handlingStrategy":"validation","validationCode":"// Pre-check each column type is supported by the StarRocks mapping\nSet<String> supported = Set.of(\"STRING\",\"BOOLEAN\",\"TINYINT\",\"SMALLINT\",\"INT\",\"BIGINT\",\"FLOAT\",\"DOUBLE\",\"DECIMAL\",\"DATE\",\"TIMESTAMP\",\"ARRAY\",\"MAP\",\"ROW\",\"BYTES\");\nschema.forEach(f -> { if (!supported.contains(f.getDataType().getSqlType().name()))\n    throw new IllegalStateException(\"Column \" + f.getName() + \" type not supported by StarRocks sink\"); });","typeGuard":"function isStarRocksMappable(sqlType) {\n  return [\"STRING\",\"BOOLEAN\",\"TINYINT\",\"SMALLINT\",\"INT\",\"BIGINT\",\"FLOAT\",\"DOUBLE\",\"DECIMAL\",\"DATE\",\"TIMESTAMP\",\"ARRAY\",\"MAP\",\"ROW\",\"BYTES\"].includes(sqlType);\n}","tryCatchPattern":"try {\n    createTableViaSaveMode(config, schema);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unsupported SeaTunnel's data type\")) {\n        // cast offending column to STRING upstream and retry\n    }\n}","preventionTips":["Cast exotic types (TIME, nested types) to STRING/JSON before a StarRocks sink.","Keep source and sink SeaTunnel versions aligned so type mappings match.","Prefer explicit target table DDL over fully automatic schema creation for odd types."],"tags":["type-mapping","starrocks","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-23T08:17:48.524Z"}