{"record":{"id":"758ed9763f362f95","repo":"apache/iceberg","slug":"unknown-row-kind-758ed9","errorCode":null,"errorMessage":"Unknown row kind: ","messagePattern":"Unknown row kind: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/sink/BaseDeltaTaskWriter.java","lineNumber":109,"sourceCode":"        break;\n\n      case UPDATE_BEFORE:\n        if (upsert) {\n          break; // UPDATE_BEFORE is not necessary for UPSERT, we do nothing to prevent delete one\n          // row twice\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  protected class RowDataDeltaWriter extends BaseEqualityDeltaWriter {\n    RowDataDeltaWriter(PartitionKey partition, PartitioningDVWriter<RowData> dvFileWriter) {\n      super(partition, schema, deleteSchema, DeleteGranularity.FILE, dvFileWriter);\n    }\n\n    @Override\n    protected StructLike asStructLike(RowData data) {\n      return wrapper.wrap(data);\n    }\n\n    @Override\n    protected StructLike asStructLikeKey(RowData data) {\n      return keyWrapper.wrap(data);\n    }\n  }","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/sink/BaseDeltaTaskWriter.java#L91-L127","documentation":"BaseDeltaTaskWriter.write dispatches RowData by RowKind: INSERT rows go to the data writer, DELETE rows to the delete writer, and UPDATE_BEFORE/UPDATE_AFTER are routed appropriately (before-images ignored or used). Any other RowKind (e.g. a future kind) reaches the default branch and throws this UnsupportedOperationException.","triggerScenarios":"Writing a RowData whose getRowKind() is not INSERT, DELETE, UPDATE_BEFORE, or UPDATE_AFTER into an Iceberg Flink sink — practically only possible with custom/updated Flink RowKind values.","commonSituations":"Custom Flink pipelines that fabricate RowData with unusual row kinds, or running a pipeline built against a newer Flink that introduced a new RowKind into an older Iceberg sink.","solutions":["Normalize incoming rows to INSERT/DELETE/UPDATE_BEFORE/UPDATE_BEFORE kinds before writing to the Iceberg sink.","Align the Flink and Iceberg versions so RowKind enums are consistent.","Audit upstream transformations (e.g. changelog producers) that might emit unexpected row kinds."],"exampleFix":"// before\nemit(row) // row with unknown RowKind\n// after\nif (row.getRowKind() == RowKind.INSERT || row.getRowKind() == RowKind.DELETE) {\n  emit(row);\n}","handlingStrategy":"validation","validationCode":"RowKind kind = row.getRowKind();\nif (kind != RowKind.INSERT && kind != RowKind.DELETE\n    && kind != RowKind.UPDATE_BEFORE && kind != RowKind.UPDATE_AFTER) {\n  throw new IllegalArgumentException(\"Row kind not supported by Iceberg sink: \" + kind);\n}","typeGuard":"boolean writableKind(RowData row) {\n  RowKind k = row.getRowKind();\n  return k == RowKind.INSERT || k == RowKind.DELETE\n      || k == RowKind.UPDATE_BEFORE || k == RowKind.UPDATE_AFTER;\n}","tryCatchPattern":"try {\n  writer.write(row);\n} catch (UnsupportedOperationException e) {\n  LOG.error(\"RowKind {} not supported by BaseDeltaTaskWriter\", row.getRowKind(), e);\n  throw e;\n}","preventionTips":["Normalize changelog streams to standard Flink RowKind values before the Iceberg sink.","Keep Flink and Iceberg connector versions aligned so RowKind definitions match.","Unit-test custom operators that synthesize RowData for row-kind correctness."],"tags":["flink","sink","unsupported-operation","rowkind"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}