{"record":{"id":"18d0fc252640ba47","repo":"apache/druid","slug":"unsupported-field-type-s","errorCode":null,"errorMessage":"Unsupported field type[%s]","messagePattern":"Unsupported field type\\[(.+?)\\]","errorType":"exception","errorClass":"UOE","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/java/util/common/parsers/ObjectFlatteners.java","lineNumber":73,"sourceCode":"    final JSONPathSpec flattenSpec = flattenSpecInput == null ? JSONPathSpec.DEFAULT : flattenSpecInput;\n    for (final JSONPathFieldSpec fieldSpec : flattenSpec.getFields()) {\n      final Function<T, Object> extractor;\n\n      switch (fieldSpec.getType()) {\n        case ROOT:\n          extractor = obj -> flattenerMaker.getRootField(obj, fieldSpec.getExpr());\n          break;\n        case PATH:\n          extractor = flattenerMaker.makeJsonPathExtractor(fieldSpec.getExpr());\n          break;\n        case JQ:\n          extractor = flattenerMaker.makeJsonQueryExtractor(fieldSpec.getExpr());\n          break;\n        case TREE:\n          extractor = flattenerMaker.makeJsonTreeExtractor(fieldSpec.getNodes());\n          break;\n        default:\n          throw new UOE(\"Unsupported field type[%s]\", fieldSpec.getType());\n      }\n\n      if (extractors.put(fieldSpec.getName(), extractor) != null) {\n        throw new IAE(\"Cannot have duplicate field definition: %s\", fieldSpec.getName());\n      }\n    }\n\n    return new ObjectFlattener<>()\n    {\n      @Override\n      public Map<String, Object> flatten(final T obj)\n      {\n        return new AbstractMap<>()\n        {\n          @Override\n          public int size()\n          {\n            return keySet().size();","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/java/util/common/parsers/ObjectFlatteners.java#L55-L91","documentation":"ObjectFlatteners.create() builds extractors for each fieldSpec in a flattenSpec; only ROOT, PATH, JQ, JSON_QUERY, and TREE field types are supported. A FieldSpec with any other type reaches the default branch and throws this UserResourceUnavailableException/UnsupportedOperationException (UOE).","triggerScenarios":"Constructing an ObjectFlattener via ObjectFlatteners.create(flattenSpec, flattenerMaker) where a FieldSpec in the flattenSpec has a type outside the supported enum handling — typically from a hand-written or deserialized flattenSpec with an unknown 'type' string.","commonSituations":"Typo in a JSON ingestion spec fieldSpec type (e.g. \"type\":\"json\" instead of \"jq\"); older/newer Druid versions where a field type was added or removed; programmatically built FieldSpec objects with garbage values.","solutions":["Fix the fieldSpec 'type' value to one of: root, path, jq, json_query, or tree","Validate the flattenSpec JSON against the Druid schema for your Druid version before submitting the spec","If using an extension-provided flattener, confirm the target parser actually supports the field type (e.g. makeJsonTreeExtractor is implemented)"],"exampleFix":"// before\n{\"type\":\"json\", \"name\":\"val\", \"expr\":\"$.a\"}\n// after\n{\"type\":\"jq\", \"name\":\"val\", \"expr\":\".a\"}","handlingStrategy":"validation","validationCode":"Set<String> allowed = Set.of(\"root\",\"path\",\"jq\",\"json_query\",\"tree\");\nfor (FieldSpec fs : flattenSpec.getFlattener()) {\n  if (!allowed.contains(fs.getType().toLowerCase())) throw new IllegalArgumentException(\"bad fieldSpec type: \" + fs.getType());\n}","typeGuard":null,"tryCatchPattern":"try { flattener = ObjectFlatteners.create(spec, maker); } catch (UOE e) { throw new SpecValidationException(\"Unsupported flattenSpec field type\", e); }","preventionTips":["Only use documented fieldSpec types: root, path, jq, json_query, tree","Validate flattenSpec JSON against your Druid version's schema","Check release notes when upgrading Druid for field-type changes"],"tags":["flatten-spec","unsupported-field-type","ingestion"],"backgroundTag":"invalid-enum-value","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}