{"record":{"id":"8cd4fc905d4caa67","repo":"apache/seatunnel","slug":"the-type-type-is-not-supported-8cd4fc","errorCode":null,"errorMessage":"The type \" + type + \" is not supported!","messagePattern":"The type \" \\+ type \\+ \" is not supported!","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-selectdb-cloud/src/main/java/org/apache/seatunnel/connectors/selectdb/serialize/SeaTunnelRowSerializer.java","lineNumber":67,"sourceCode":"            boolean enableDelete) {\n        this.type = type;\n        this.seaTunnelRowType = seaTunnelRowType;\n        this.fieldDelimiter = fieldDelimiter;\n        this.enableDelete = enableDelete;\n        if (JSON.equals(type)) {\n            objectMapper = new ObjectMapper();\n        }\n    }\n\n    @Override\n    public byte[] serialize(SeaTunnelRow seaTunnelRow) throws IOException {\n        String valString;\n        if (JSON.equals(type)) {\n            valString = buildJsonString(seaTunnelRow);\n        } else if (CSV.equals(type)) {\n            valString = buildCSVString(seaTunnelRow);\n        } else {\n            throw new IllegalArgumentException(\"The type \" + type + \" is not supported!\");\n        }\n        return valString.getBytes(StandardCharsets.UTF_8);\n    }\n\n    public String buildJsonString(SeaTunnelRow row) throws IOException {\n        Map<String, Object> rowMap = new HashMap<>(row.getFields().length);\n\n        for (int i = 0; i < row.getFields().length; i++) {\n            Object value = convert(seaTunnelRowType.getFieldType(i), row.getField(i));\n            rowMap.put(seaTunnelRowType.getFieldName(i), value);\n        }\n        if (enableDelete) {\n            rowMap.put(LoadConstants.DORIS_DELETE_SIGN, parseDeleteSign(row.getRowKind()));\n        }\n        return objectMapper.writeValueAsString(rowMap);\n    }\n\n    public String buildCSVString(SeaTunnelRow row) throws IOException {","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-selectdb-cloud/src/main/java/org/apache/seatunnel/connectors/selectdb/serialize/SeaTunnelRowSerializer.java#L49-L85","documentation":"SeaTunnelRowSerializer serializes SeaTunnelRow records into a payload format for SelectDB Cloud load. Only the 'json' and 'csv' formats (case-matched constants) are supported; any other configured value throws this IllegalArgumentException at the first row serialized.","triggerScenarios":"The sink's serializer format option (seaTunnelRowSerializerBuilder format) is set to a string other than JSON or CSV, e.g. 'parquet' or 'JSON' with different casing than the constants, and serialize() is invoked on the first record.","commonSituations":"Typo in the format config value; using uppercase 'JSON'/'CSV' when constants compare case-sensitively; copying config from another sink that supports more formats.","solutions":["Set the sink format option to exactly 'json' or 'csv' (match the constant values in the connector)","Check the builder/config code that passes the format string to SeaTunnelRowSerializer and fix the value at the source","If another format is genuinely needed, extend serialize() with a new branch and contribute it upstream"],"exampleFix":"// before\nformat = \"JSON\"; // throws IllegalArgumentException\n// after\nformat = \"json\"; // matches JSON constant, uses buildJsonString","handlingStrategy":"validation","validationCode":"if (!\"json\".equals(format) && !\"csv\".equals(format)) { throw new IllegalArgumentException(\"format must be json or csv, got: \" + format); }","typeGuard":null,"tryCatchPattern":"try { serializer.serialize(row); } catch (IllegalArgumentException e) { /* fix config, fail fast at startup */ }","preventionTips":["Validate the format option at config-parse time, before job submission","Match constant values exactly (case-sensitive)","Whitelist supported formats in your config layer"],"tags":["serialization","selectdb","invalid-enum-value"],"backgroundTag":"invalid-enum-value","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"}