{"record":{"id":"4e56abb6f468a90b","repo":"apache/seatunnel","slug":"unrecognized-row-kind-rowkind-tostring","errorCode":null,"errorMessage":"Unrecognized row kind:\" + rowKind.toString()","messagePattern":"Unrecognized row kind:\" \\+ rowKind\\.toString\\(\\)","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":104,"sourceCode":"        StringJoiner joiner = new StringJoiner(fieldDelimiter);\n        for (int i = 0; i < row.getFields().length; i++) {\n            Object field = convert(seaTunnelRowType.getFieldType(i), row.getField(i));\n            String value = field != null ? field.toString() : NULL_VALUE;\n            joiner.add(value);\n        }\n        if (enableDelete) {\n            joiner.add(parseDeleteSign(row.getRowKind()));\n        }\n        return joiner.toString();\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    public static Builder builder() {\n        return new Builder();\n    }\n\n    /** Builder for RowDataSerializer. */\n    public static class Builder {\n        private SeaTunnelRowType seaTunnelRowType;\n        private String type;\n        private String fieldDelimiter;\n        private boolean deletable;\n\n        public Builder setType(String type) {\n            this.type = type;\n            return this;\n        }","sourceCodeStart":86,"sourceCodeEnd":122,"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#L86-L122","documentation":"parseDeleteSign maps a SeaTunnel RowKind to SelectDB's DORIS delete sign value: INSERT/UPDATE_AFTER map to '0' (not deleted), DELETE/UPDATE_BEFORE map to '1' (deleted). Any other RowKind (or a null RowKind falling through) throws this IllegalArgumentException.","triggerScenarios":"A SeaTunnelRow with a RowKind outside the four handled values (e.g. a null RowKind or a newly added kind) reaches the serializer during CDC writing.","commonSituations":"Custom sources emitting rows without RowKind set; connector translation bugs producing unexpected row kinds; upstream CDC framework changes introducing new kinds not handled here.","solutions":["Inspect the upstream source/transform producing the row and ensure RowKind is explicitly set to INSERT/DELETE/UPDATE_BEFORE/UPDATE_AFTER","Log or dump row.getRowKind() upstream to identify the unexpected kind","If a new RowKind must be supported, add a branch to parseDeleteSign"],"exampleFix":"// before\n// row created without RowKind, defaults unexpectedly\n// after\nrow.setRowKind(RowKind.INSERT); // or DELETE/UPDATE_BEFORE/UPDATE_BEFORE before writing","handlingStrategy":"validation","validationCode":"EnumSet.of(RowKind.INSERT, RowKind.DELETE, RowKind.UPDATE_BEFORE, RowKind.UPDATE_AFTER).contains(row.getRowKind())","typeGuard":null,"tryCatchPattern":"try { sign = parseDeleteSign(rowKind); } catch (IllegalArgumentException e) { log.error(\"Unsupported RowKind: {}\", rowKind); throw e; }","preventionTips":["Always set RowKind explicitly when constructing SeaTunnelRow in custom sources","Test custom sources against the CDC-enabled SelectDB sink","Keep parseDeleteSign in sync when new RowKinds are introduced"],"tags":["cdc","rowkind","selectdb"],"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-23T08:17:48.524Z"}