{"record":{"id":"7404338808b00142","repo":"apache/beam","slug":"unexpected-mutation-type-s-key-value-is-s","errorCode":null,"errorMessage":"Unexpected mutation type [%s]: Key value is %s","messagePattern":"Unexpected mutation type \\[(.+?)\\]: Key value is (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableWriteSchemaTransformProvider.java","lineNumber":355,"sourceCode":"                            bigtableMutation =\n                                Mutation.newBuilder()\n                                    .setDeleteFromFamily(\n                                        Mutation.DeleteFromFamily.newBuilder()\n                                            .setFamilyName(\n                                                Preconditions.checkStateNotNull(\n                                                    input.getString(\"family_name\"),\n                                                    \"Encountered DeleteFromFamily mutation with null 'family_name' property.\"))\n                                            .build())\n                                    .build();\n                            break;\n                          case \"DeleteFromRow\":\n                            bigtableMutation =\n                                Mutation.newBuilder()\n                                    .setDeleteFromRow(Mutation.DeleteFromRow.newBuilder().build())\n                                    .build();\n                            break;\n                          default:\n                            throw new RuntimeException(\n                                String.format(\n                                    \"Unexpected mutation type [%s]: Key value is %s\",\n                                    input.getString(\"type\"),\n                                    Arrays.toString(input.getBytes(\"key\"))));\n                        }\n                        return KV.of(key, bigtableMutation);\n                      }));\n      // now we need to make the KV into a PCollection of KV<ByteString, Iterable<Mutation>>\n      return changedBeamRowMutationsList.apply(GroupByKey.create());\n    }\n  }\n\n  public static class GetMutationsFromBeamRow\n      extends SimpleFunction<Row, KV<ByteString, Iterable<Mutation>>> {\n    @Override\n    public KV<ByteString, Iterable<Mutation>> apply(Row row) {\n      ByteString key = ByteString.copyFrom(ofNullable(row.getBytes(\"key\")).get());\n      List<Map<String, byte[]>> beamRowMutations =","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableWriteSchemaTransformProvider.java#L337-L373","documentation":"In changeMutationInput, after checking the known mutation types (SetCell, DeleteFamily, etc.), the default branch throws a RuntimeException formatted with the unrecognized type and the row's key. This catches any 'type' string outside the supported set.","triggerScenarios":"A row whose 'type' field is a non-null string that isn't exactly one of SetCell, DeleteFamily, DeleteColumn, DeleteRow — e.g. 'setcell' (wrong case), 'SET_CELL', 'put', or arbitrary garbage data.","commonSituations":"Data sourced from systems with different mutation vocabularies (e.g. HBase 'Put'/'Delete' verbs); case-sensitivity bugs; users inventing new type names expecting support.","solutions":["Use exactly one of: SetCell, DeleteFamily, DeleteColumn, DeleteRow for the 'type' value (case-sensitive)","Normalize the type string upstream (e.g. map HBase 'Put' to 'SetCell')","Check the key value printed in the error to identify the offending record and fix or drop it"],"exampleFix":"// before\nrow.get(\"type\") == \"put\" // unsupported\n// after\nrow.get(\"type\") == \"SetCell\" // supported, case-sensitive","handlingStrategy":"validation","validationCode":"Set<String> VALID = Set.of(\"SetCell\",\"DeleteFamily\",\"DeleteColumn\",\"DeleteRow\");\nboolean validType(Row row) {\n  String t = row.getString(\"type\");\n  return t != null && VALID.contains(t);\n}","typeGuard":"boolean isKnownMutationType(Row row) {\n  String t = row.getString(\"type\");\n  return \"SetCell\".equals(t) || \"DeleteFamily\".equals(t)\n      || \"DeleteColumn\".equals(t) || \"DeleteRow\".equals(t);\n}","tryCatchPattern":null,"preventionTips":["Use exact case-sensitive type names from the provider's switch","Normalize external mutation vocabularies (e.g. HBase verbs) upstream","Log the offending key (printed in the error) and dead-letter that record"],"tags":["gcp","bigtable","mutation","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}