{"record":{"id":"4d46c147e18f839f","repo":"apache/seatunnel","slug":"unrecognized-row-kind-rowkind","errorCode":null,"errorMessage":"Unrecognized row kind:<rowKind>","messagePattern":"Unrecognized row kind:<rowKind>","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/serialize/SeaTunnelRowSerializer.java","lineNumber":123,"sourceCode":"    }\n\n    public byte[] buildJsonString(SeaTunnelRow row) {\n\n        return serialize.serialize(row);\n    }\n\n    public byte[] buildCSVString(SeaTunnelRow row) {\n\n        return serialize.serialize(row);\n    }\n\n    public String parseDeleteSign(RowKind rowKind) {\n        if (RowKind.INSERT.equals(rowKind) || RowKind.UPDATE_AFTER.equals(rowKind)) {\n            return \"0\";\n        } else if (RowKind.DELETE.equals(rowKind) || RowKind.UPDATE_BEFORE.equals(rowKind)) {\n            return \"1\";\n        } else {\n            throw new IllegalArgumentException(\"Unrecognized row kind:\" + rowKind.toString());\n        }\n    }\n\n    @Override\n    public void open() throws IOException {}\n\n    @Override\n    public byte[] serialize(SeaTunnelRow seaTunnelRow) throws IOException {\n\n        if (enableDelete) {\n\n            List<Object> newFields = new ArrayList<>(Arrays.asList(seaTunnelRow.getFields()));\n            newFields.add(parseDeleteSign(seaTunnelRow.getRowKind()));\n            seaTunnelRow = new SeaTunnelRow(newFields.toArray());\n        }\n\n        if (JSON.equals(type)) {\n            return buildJsonString(seaTunnelRow);","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/serialize/SeaTunnelRowSerializer.java#L105-L141","documentation":"SeaTunnelRowSerializer.parseDeleteSign maps RowKind to the Doris stream-load delete sign (0 for insert/update-after, 1 for delete/update-before). RowKind.READ or any unexpected kind throws IllegalArgumentException because the serializer cannot decide whether the row is an insert or a delete.","triggerScenarios":"Sink receiving rows whose RowKind is not INSERT/UPDATE_AFTER/DELETE/UPDATE_BEFORE — typically RowKind.READ produced by a non-CDC source when `cdc-enabled`/deletable semantics were wrongly assumed, or custom transforms resetting the row kind.","commonSituations":"Feeding a batch/snapshot source into a Doris sink configured for CDC (enable-delete with primary-key table); a transform that constructs SeaTunnelRow with RowKind.READ; version changes in RowKind enum handling.","solutions":["Ensure the source emits CDC semantics (CDC-enabled source or SeaTunnelRow with correct RowKind), or disable delete-sign handling for non-CDC pipelines","Normalize RowKind in a transform: map READ rows to INSERT before the sink","Check that upstream transforms don't overwrite the RowKind"],"exampleFix":"// before\nSeaTunnelRow row = new SeaTunnelRow(values); // RowKind.READ\n// after\nrow.setRowKind(RowKind.INSERT);","handlingStrategy":"type-guard","validationCode":"RowKind k = row.getRowKind();\nif (!(k == RowKind.INSERT || k == RowKind.UPDATE_AFTER || k == RowKind.DELETE || k == RowKind.UPDATE_BEFORE)) throw new IllegalStateException(\"non-CDC row in CDC sink: \" + k);","typeGuard":"boolean isCdcRowKind(RowKind k) { return k == RowKind.INSERT || k == RowKind.UPDATE_AFTER || k == RowKind.DELETE || k == RowKind.UPDATE_BEFORE; }","tryCatchPattern":null,"preventionTips":["Only enable delete-sign/CDC mode with CDC-capable sources","Insert a transform to normalize RowKind.READ to INSERT for batch data","Assert RowKind in tests covering your pipeline"],"tags":["cdc","row-kind","doris","serialization"],"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"}