{"record":{"id":"157ceb779ab4b152","repo":"apache/seatunnel","slug":"unknown-row-kind","errorCode":null,"errorMessage":"Unknown row kind: ","messagePattern":"Unknown row kind: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/sink/writer/BaseDeltaTaskWriter.java","lineNumber":107,"sourceCode":"                }\n                writer.write(row);\n                break;\n            case UPDATE_BEFORE:\n                if (upsert) {\n                    break;\n                }\n                writer.delete(row);\n                break;\n            case DELETE:\n                if (upsert) {\n                    writer.deleteKey(keyProjection.wrap(row));\n                } else {\n                    writer.delete(row);\n                }\n                break;\n\n            default:\n                throw new UnsupportedOperationException(\"Unknown row kind: \" + row.getRowKind());\n        }\n    }\n\n    class RowDataDeltaWriter extends BaseEqualityDeltaWriter {\n        RowDataDeltaWriter(PartitionKey partition) {\n            super(partition, schema, deleteSchema);\n        }\n\n        @Override\n        protected StructLike asStructLike(Record data) {\n            return wrapper.wrap(data);\n        }\n\n        @Override\n        protected StructLike asStructLikeKey(Record data) {\n            return keyWrapper.wrap(data);\n        }\n    }","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/sink/writer/BaseDeltaTaskWriter.java#L89-L125","documentation":"BaseDeltaTaskWriter.write throws UnsupportedOperationException when a CDC row's RowKind is not one of the supported kinds (INSERT, UPDATE_AFTER -> upsert, UPDATE_BEFORE/DELETE -> delete). Any other RowKind reaches the default branch and is rejected. This guards the equality-delete upsert writer against unexpected CDC semantics.","triggerScenarios":"Writing a row to the Iceberg sink in CDC/upsert mode whose SeaTunnel RowKind is outside the supported set (e.g. custom/future kinds or rows not properly marked by the source).","commonSituations":"Batch (non-CDC) job writing rows with a RowKind the CDC path does not expect; source connector emitting exotic row kinds; enabling 'schema-save-mode'/'upsert' for a source that does not produce proper CDC markers.","solutions":["Check row.getRowKind() values your source emits; log the first offending kind to confirm.","Ensure the source produces only INSERT/DELETE/UPDATE_BEFORE/UPDATE_AFTER kinds when CDC mode is enabled.","If writing a batch job, do not enable upsert/CDC options on the Iceberg sink so rows are written directly.","Upgrade SeaTunnel if the source recently introduced a new RowKind not yet handled by the sink."],"exampleFix":"// before\nrow.setRowKind(customKind); // unsupported kind reaching writer\n// after\nrow.setRowKind(RowKind.INSERT); // or UPDATE_AFTER/UPDATE_BEFORE/DELETE for CDC","handlingStrategy":"validation","validationCode":"if (cdcMode && row.getRowKind() != RowKind.INSERT && row.getRowKind() != RowKind.UPDATE_AFTER && row.getRowKind() != RowKind.UPDATE_BEFORE && row.getRowKind() != RowKind.DELETE) { throw new IllegalStateException(\"Unsupported RowKind for Iceberg upsert: \" + row.getRowKind()); }","typeGuard":null,"tryCatchPattern":"try { writer.write(row); } catch (UnsupportedOperationException e) { if (e.getMessage().startsWith(\"Unknown row kind\")) { log.error(\"Unsupported RowKind from source: {}\", e.getMessage()); /* skip/DLQ row */ } else throw e; }","preventionTips":["Only enable CDC/upsert mode with sources that emit standard INSERT/UPDATE_BEFORE/UPDATE_AFTER/DELETE kinds","Use INSERT mode for batch (non-CDC) Iceberg writes","Log RowKind distribution in a sample run before enabling equality-delete writers"],"tags":["iceberg","cdc","row-kind","unsupported-operation","sink"],"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"}