{"record":{"id":"20cb66df5cb34a96","repo":"apache/seatunnel","slug":"unsupported-operation-20cb66","errorCode":"UNSUPPORTED_OPERATION","errorMessage":"Unsupported operation %s for row kind.","messagePattern":"Unsupported operation (.+?) for row kind\\.","errorType":"error_code","errorClass":"SeaTunnelJsonFormatException","httpStatus":null,"severity":"error","filePath":"seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/ogg/OggJsonSerializationSchema.java","lineNumber":109,"sourceCode":"            return jsonSerializer.serialize(reuse);\n        } catch (Throwable t) {\n            throw CommonError.jsonOperationError(FORMAT, row.toString(), t);\n        }\n    }\n\n    private String rowKind2String(RowKind rowKind) {\n        switch (rowKind) {\n            case INSERT:\n            case UPDATE_AFTER:\n                if (mergeUpdateEventFlag && rowKind.equals(RowKind.UPDATE_AFTER)) {\n                    return OP_UPDATE;\n                }\n                return OP_INSERT;\n            case UPDATE_BEFORE:\n            case DELETE:\n                return OP_DELETE;\n            default:\n                throw new SeaTunnelJsonFormatException(\n                        CommonErrorCodeDeprecated.UNSUPPORTED_OPERATION,\n                        String.format(\"Unsupported operation %s for row kind.\", rowKind));\n        }\n    }\n\n    private static SeaTunnelRowType createJsonRowType(SeaTunnelRowType databaseSchema) {\n        return new SeaTunnelRowType(\n                new String[] {\"before\", \"after\", \"op_type\", \"table\", \"op_ts\"},\n                new SeaTunnelDataType[] {\n                    databaseSchema, databaseSchema, STRING_TYPE, STRING_TYPE, LONG_TYPE\n                });\n    }\n}\n","sourceCodeStart":91,"sourceCodeEnd":123,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/ogg/OggJsonSerializationSchema.java#L91-L123","documentation":"Thrown by OggJsonSerializationSchema.rowKind2String when converting a SeaTunnelRow's RowKind into the OGG operation string. Only INSERT, UPDATE_AFTER (mapped to insert), UPDATE_BEFORE and DELETE (mapped to delete) are handled; any other RowKind reaches the default branch and throws SeaTunnelJsonFormatException with UNSUPPORTED_OPERATION.","triggerScenarios":"Serializing a row whose RowKind is not one of INSERT, UPDATE_AFTER, UPDATE_BEFORE, DELETE — e.g. a SeaTunnelRow constructed programmatically by a custom transform or connector emitting an exotic kind, then passed to serialize.","commonSituations":"Custom Source/Transform producing rows with unexpected RowKind; pipeline wiring where a CDC connector emits kinds the Ogg serializer was not designed for; unit tests building rows with a default/unsupported RowKind.","solutions":["Check what RowKind the upstream source/transform produces and make it emit only INSERT/UPDATE_AFTER/UPDATE_BEFORE/DELETE","Insert a transform/filter stage that normalizes or drops rows with unsupported RowKind","Use a different serialization format (e.g. canal-json or debezium-json) if the pipeline carries CDC kinds outside OGG's model"],"exampleFix":"// before\nSeaTunnelRow row = new SeaTunnelRow(...); // RowKind left unsupported\n\n// after\nrow.setRowKind(RowKind.INSERT); // or UPDATE_AFTER / DELETE\nserialize(row);","handlingStrategy":"type-guard","validationCode":"if (row.getRowKind() != RowKind.INSERT && row.getRowKind() != RowKind.UPDATE_AFTER\n    && row.getRowKind() != RowKind.UPDATE_BEFORE && row.getRowKind() != RowKind.DELETE) {\n    throw new IllegalArgumentException(\"RowKind not serializable to ogg-json: \" + row.getRowKind());\n}","typeGuard":"boolean isOggSerializableKind(RowKind kind) {\n    return kind == RowKind.INSERT || kind == RowKind.UPDATE_AFTER\n        || kind == RowKind.UPDATE_BEFORE || kind == RowKind.DELETE;\n}","tryCatchPattern":"try {\n    byte[] bytes = schema.serialize(row);\n} catch (SeaTunnelJsonFormatException e) {\n    log.warn(\"Unsupported RowKind {} for ogg-json sink\", row.getRowKind(), e);\n    // normalize or drop the row\n}","preventionTips":["Normalize RowKind in a transform immediately before the sink","Only use ogg-json serialization for pipelines whose sources emit standard CDC kinds","Add unit tests asserting the RowKind your source/transform emits"],"tags":["serialization","ogg","cdc","row-kind"],"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-14T11:17:12.474Z"}