{"record":{"id":"bf8e6f08654a45f3","repo":"apache/seatunnel","slug":"unsupported-byte-value-value-for-row-kind","errorCode":null,"errorMessage":"Unsupported byte value '${value}' for row kind.","messagePattern":"Unsupported byte value '(.+?)' for row kind\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/table/type/RowKind.java","lineNumber":113,"sourceCode":"    /**\n     * Creates a {@link RowKind} from the given byte value. Each {@link RowKind} has a byte value\n     * representation.\n     *\n     * @see #toByteValue() for mapping of byte value and {@link RowKind}.\n     */\n    @SuppressWarnings(\"MagicNumber\")\n    public static RowKind fromByteValue(byte value) {\n        switch (value) {\n            case 0:\n                return INSERT;\n            case 1:\n                return UPDATE_BEFORE;\n            case 2:\n                return UPDATE_AFTER;\n            case 3:\n                return DELETE;\n            default:\n                throw new UnsupportedOperationException(\n                        \"Unsupported byte value '\" + value + \"' for row kind.\");\n        }\n    }\n}\n","sourceCodeStart":95,"sourceCodeEnd":118,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/type/RowKind.java#L95-L118","documentation":"RowKind.fromByteValue maps the wire bytes 0..3 (INSERT, UPDATE_BEFORE, UPDATE_AFTER, DELETE) to RowKind values. Any other byte has no defined row kind, so UnsupportedOperationException is thrown to catch corrupt or protocol-violating data.","triggerScenarios":"Deserializing CDC/binlog-like payloads where the row-kind byte is corrupted, comes from an unsupported protocol version, or a caller passes an arbitrary byte (e.g. 4, 0x7F) to fromByteValue.","commonSituations":"Reading records from an incompatible or newer producer that encodes extra row kinds; bit-manipulation bugs packing flags into the kind byte; hand-written serializers writing wrong byte values.","solutions":["Verify the producing format: only bytes 0-3 are valid SeaTunnel row kinds","Log and inspect the offending byte to identify the corrupt source or version mismatch","Upgrade reader/writer versions so both sides use the same row-kind encoding","Validate the byte before calling: if (value >= 0 && value <= 3) RowKind.fromByteValue(value);"],"exampleFix":"// before\nRowKind kind = RowKind.fromByteValue(rawByte); // throws on 4+\n// after\nif (rawByte < 0 || rawByte > 3) {\n    throw new IOException(\"Corrupt row kind byte: \" + rawByte);\n}\nRowKind kind = RowKind.fromByteValue(rawByte);","handlingStrategy":"validation","validationCode":"if (value < 0 || value > 3) {\n    throw new IOException(\"Invalid row kind byte: \" + value);\n}\nRowKind kind = RowKind.fromByteValue(value);","typeGuard":null,"tryCatchPattern":"try {\n    RowKind kind = RowKind.fromByteValue(value);\n} catch (UnsupportedOperationException e) {\n    // skip record, increment corrupt-record metric, or route to DLQ\n}","preventionTips":["Ensure producer and reader agree on row-kind encoding versions","Never pack flags into the row-kind byte","Validate bytes at the deserializer boundary","Route unknown kinds to a dead-letter path instead of crashing"],"tags":["row-kind","deserialization","byte"],"backgroundTag":"unsupported-enum-value","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"}