{"record":{"id":"f66959f07aa6d03f","repo":"apache/seatunnel","slug":"unsupported-row-kind-f66959","errorCode":null,"errorMessage":"Unsupported row kind.","messagePattern":"Unsupported row kind\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/serialize/StarRocksSinkOP.java","lineNumber":41,"sourceCode":" * Reference\n * https://github.com/StarRocks/starrocks/blob/main/docs/loading/Load_to_Primary_Key_tables.md#upsert-and-delete\n */\npublic enum StarRocksSinkOP {\n    UPSERT,\n    DELETE;\n\n    public static final String COLUMN_KEY = \"__op\";\n\n    static StarRocksSinkOP parse(RowKind kind) {\n        switch (kind) {\n            case INSERT:\n            case UPDATE_AFTER:\n                return UPSERT;\n            case DELETE:\n            case UPDATE_BEFORE:\n                return DELETE;\n            default:\n                throw new RuntimeException(\"Unsupported row kind.\");\n        }\n    }\n}\n","sourceCodeStart":23,"sourceCodeEnd":45,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/serialize/StarRocksSinkOP.java#L23-L45","documentation":"StarRocksSinkOP.parse maps a SeaTunnel RowKind to the StarRocks stream-load __op value (UPSERT/DELETE/INSERT). RowKind covers INSERT, DELETE, UPDATE_AFTER, UPDATE_BEFORE; any other/null kind falls to default and throws a plain RuntimeException('Unsupported row kind.').","triggerScenarios":"Row arriving at the sink with RowKind other than the four handled values (e.g. a null or future/unknown kind) during CDC or transform processing.","commonSituations":"Custom Source/Transform emitting rows with RowKind null or an unmapped kind feeding a StarRocks sink; CDC pipeline producing unexpected row kinds; bug in upstream connector emitting RowKind beyond the enum's known values.","solutions":["Ensure the upstream source/transform always sets a valid RowKind (INSERT/UPDATE_AFTER/DELETE)","Filter or normalize row kinds before the sink (e.g. drop UPDATE_BEFORE rows)","Check which connector/transform produced the row and upgrade/fix it","Catch this at job design time: CDC pipelines for StarRocks should emit UPSERT/DELETE-compatible kinds"],"exampleFix":"// before\nrow.setRowKind(null); // or unknown kind -> RuntimeException\n// after\nrow.setRowKind(RowKind.INSERT); // or UPDATE_AFTER / DELETE","handlingStrategy":"try-catch","validationCode":"if (row.getRowKind() == null) throw new IllegalStateException(\"Row has null RowKind before StarRocks sink\");","typeGuard":"boolean hasSinkableRowKind(Row row) { RowKind k = row.getRowKind(); return k == RowKind.INSERT || k == RowKind.UPDATE_AFTER || k == RowKind.DELETE; }","tryCatchPattern":"try { sinkWriter.write(row); } catch (RuntimeException e) { if (\"Unsupported row kind.\".equals(e.getMessage())) { log.error(\"Row kind {} not sinkable; normalize upstream\", row.getRowKind(), e); } throw e; }","preventionTips":["Normalize RowKind before the sink (drop UPDATE_BEFORE, map INSERT/UPDATE_AFTER/DELETE)","Verify CDC sources emit only StarRocks-compatible kinds","Add a transform step that asserts/kinds rows when mixing connectors"],"tags":["starrocks","sink","rowkind","cdc"],"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"}