{"record":{"id":"98d7fa24bb94b1b4","repo":"apache/seatunnel","slug":"unsupported-rowkind-rowkind","errorCode":null,"errorMessage":"Unsupported rowKind: \" + rowKind","messagePattern":"Unsupported rowKind: \" \\+ rowKind","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/client/executor/ReduceBufferedBatchStatementExecutor.java","lineNumber":114,"sourceCode":"    @Override\n    public void closeStatements() throws SQLException {\n        if (!buffer.isEmpty()) {\n            executeBatch();\n        }\n        insertOrUpdateExecutor.closeStatements();\n        deleteExecutor.closeStatements();\n    }\n\n    private boolean changeFlag(RowKind rowKind) {\n        switch (rowKind) {\n            case INSERT:\n            case UPDATE_AFTER:\n                return true;\n            case DELETE:\n            case UPDATE_BEFORE:\n                return false;\n            default:\n                throw new UnsupportedOperationException(\"Unsupported rowKind: \" + rowKind);\n        }\n    }\n}\n","sourceCodeStart":96,"sourceCodeEnd":118,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/sink/client/executor/ReduceBufferedBatchStatementExecutor.java#L96-L118","documentation":"ReduceBufferedBatchStatementExecutor only supports CDC row kinds INSERT, DELETE, UPDATE_AFTER, and UPDATE_BEFORE; any other RowKind (e.g. INSERT-less custom kinds) reaching the changeFlag logic throws UnsupportedOperationException. It indicates an upstream produced a row kind the buffered CDC executor cannot classify.","triggerScenarios":"A SeaTunnelRow with a RowKind outside {INSERT, DELETE, UPDATE_BEFORE, UPDATE_AFTER} (e.g. custom/unmapped kinds) flows into the ClickHouse sink with support_upsert/cdc enabled, hitting the default branch of the switch in changeFlag.","commonSituations":"A source/transform upstream emits non-standard row kinds or a new RowKind added in a newer SeaTunnel version that this executor has not been extended to handle.","solutions":["Check the upstream source/transform for why a non-CDC RowKind is emitted and fix it there","Ensure the source's CDC capability maps all events to supported INSERT/UPDATE_BEFORE/UPDATE_AFTER/DELETE kinds","Upgrade the connector/SeaTunnel version where additional RowKinds may be supported"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// filter/normalize rows before the sink\nif (row.getRowKind() != RowKind.INSERT && row.getRowKind() != RowKind.DELETE\n && row.getRowKind() != RowKind.UPDATE_BEFORE && row.getRowKind() != RowKind.UPDATE_AFTER)\n  throw new IllegalStateException(\"unsupported RowKind for ClickHouse cdc sink: \" + row.getRowKind());","typeGuard":"boolean isSupportedRowKind(SeaTunnelRow row) {\n  switch (row.getRowKind()) {\n    case INSERT: case DELETE: case UPDATE_BEFORE: case UPDATE_AFTER: return true;\n    default: return false;\n  }\n}","tryCatchPattern":null,"preventionTips":["Ensure upstream sources emit only standard CDC row kinds","Add a transform to normalize/drop unsupported row kinds before the ClickHouse sink","Keep connector and engine versions aligned when new RowKinds are introduced"],"tags":["clickhouse","cdc","rowkind","unsupported-operation"],"backgroundTag":"unsupported-operation","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"}