{"record":{"id":"a7d829cd48bb8d6f","repo":"apache/druid","slug":"invalid-map-field","errorCode":null,"errorMessage":"Invalid map field.","messagePattern":"Invalid map field\\.","errorType":"exception","errorClass":"InvalidProtocolBufferException","httpStatus":null,"severity":"error","filePath":"extensions-core/protobuf-extensions/src/main/java/org/apache/druid/data/input/protobuf/ProtobufConverter.java","lineNumber":118,"sourceCode":"  private static List<Object> convertList(Descriptors.FieldDescriptor field, List<?> value)\n      throws InvalidProtocolBufferException\n  {\n    final List<Object> theList = Lists.newArrayListWithExpectedSize(value.size());\n    for (Object element : value) {\n      theList.add(convertSingleValue(field, element));\n    }\n    return theList;\n  }\n\n  @Nullable\n  private static Object convertMap(Descriptors.FieldDescriptor field, Object value)\n      throws InvalidProtocolBufferException\n  {\n    final Descriptors.Descriptor type = field.getMessageType();\n    final Descriptors.FieldDescriptor keyField = type.findFieldByName(\"key\");\n    final Descriptors.FieldDescriptor valueField = type.findFieldByName(\"value\");\n    if (keyField == null || valueField == null) {\n      throw new InvalidProtocolBufferException(\"Invalid map field.\");\n    }\n\n    @SuppressWarnings(\"unchecked\")\n    final List<Object> elements = (List<Object>) value;\n    final HashMap<String, Object> theMap = Maps.newHashMapWithExpectedSize(elements.size());\n    for (Object element : elements) {\n      Message entry = (Message) element;\n      theMap.put(\n          (String) convertSingleValue(keyField, entry.getField(keyField)),\n          convertSingleValue(valueField, entry.getField(valueField))\n      );\n    }\n    return theMap;\n  }\n\n  @Nullable\n  private static Object convertSingleValue(Descriptors.FieldDescriptor field, Object value)\n      throws InvalidProtocolBufferException","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/protobuf-extensions/src/main/java/org/apache/druid/data/input/protobuf/ProtobufConverter.java#L100-L136","documentation":"Structure validation in ProtobufConverter.convertMap: the field expected to be a protobuf map entry lacks the required key/value message-type structure (message type or key/value field descriptors missing), so the converter cannot iterate it as a map.","triggerScenarios":"Thrown at extensions-core/protobuf-extensions/src/main/java/org/apache/druid/data/input/protobuf/ProtobufConverter.java:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the .proto schema actually declares the field as a map<K,V> entry.","Regenerate the descriptor from the correct schema version.","Check that the message instance matches the descriptor used to parse it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}