{"record":{"id":"2b387d5be3798928","repo":"apache/druid","slug":"input-source-type-s-is-required","errorCode":null,"errorMessage":"Input source type %s is required","messagePattern":"Input source type (.+?) is required","errorType":"validation","errorClass":"IAE","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/catalog/model/table/ResolvedExternalTable.java","lineNumber":86,"sourceCode":"\n  public ResolvedTable resolvedTable()\n  {\n    return table;\n  }\n\n  /**\n   * Look up the input source type and input format type to find the corresponding\n   * definitions in the table registry. Throws an exception if the types are not\n   * defined. The input source is required, the format is optional.\n   * <p>\n   * Note, for resolution to work, the name of each definition must be the same as\n   * that used as the type key in the serialized JSON.\n   */\n  public ResolvedExternalTable resolve(TableDefnRegistry registry)\n  {\n    String inputSourceType = CatalogUtils.getString(inputSourceMap, InputSource.TYPE_PROPERTY);\n    if (inputSourceType == null) {\n      throw new IAE(\"Input source type %s is required\", InputSource.TYPE_PROPERTY);\n    }\n    inputSourceDefn = registry.inputSourceDefnFor(inputSourceType);\n    if (inputSourceDefn == null) {\n      throw new IAE(\"Input source type %s is not registered\", inputSourceType);\n    }\n    if (inputFormatMap != null) {\n      String inputFormatType = CatalogUtils.getString(inputFormatMap, InputFormat.TYPE_PROPERTY);\n      if (inputFormatType != null) {\n        inputFormatDefn = registry.inputFormatDefnFor(inputFormatType);\n        if (inputFormatDefn == null) {\n          throw new IAE(\"Input format type %s is not registered\", inputFormatType);\n        }\n      }\n    }\n    return this;\n  }\n\n  /**","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/catalog/model/table/ResolvedExternalTable.java#L68-L104","documentation":"Within an external table's input-source map, the type property identifies which input source definition applies. resolve() reads it to look up the registered TableDefnRegistry entry; a missing type means the input source cannot be classified, so this IAE is thrown (it precedes the separate 'not registered' check).","triggerScenarios":"Calling resolve() (usually via table validate) on a table whose inputSourceMap exists but lacks the \"type\" key inside the source map.","commonSituations":"Hand-built source maps missing type; key casing mistakes (Type vs type); serializers that drop the type field because it matched a default.","solutions":["Add \"type\" inside the source map, e.g. \"source\":{\"type\":\"local\",\"...\"}","Check spelling/casing of the type key matches InputSource.TYPE_PROPERTY","Round-trip the spec through the catalog API to see the canonical serialized form"],"exampleFix":"// before\n\"source\":{\"baseDir\":\"/data\"}\n// after\n\"source\":{\"type\":\"local\",\"baseDir\":\"/data\"}","handlingStrategy":"validation","validationCode":"// Java\nObject type = ((Map<?,?>) spec.get(\"source\")).get(\"type\");\nif (type == null || type.toString().isEmpty())\n  throw new IllegalArgumentException(\"input source map requires 'type' field\");","typeGuard":"// Java\nstatic boolean hasInputSourceType(Map<String,Object> sourceMap) {\n  return sourceMap.get(\"type\") instanceof String && !((String) sourceMap.get(\"type\")).isEmpty();\n}","tryCatchPattern":"try { resolved.resolve(registry); } catch (IAE e) { if (e.getMessage().contains(\"type\") && e.getMessage().contains(\"required\")) { /* add type to source map */ } else throw e; }","preventionTips":["Always serialize the type field in input-source maps","Verify specs survive JSON round-trips without losing type","Use InputSource.TYPE_PROPERTY constant in programmatic construction"],"tags":["druid-catalog","validation","input-source","missing-property"],"backgroundTag":"missing-required-config-field","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"}