apache/druid · error · IAE

Input source type is required

Error message

Input source type %s is required

What it means

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).

Solutions

  1. Add "type" inside the source map, e.g. "source":{"type":"local","..."}
  2. Check spelling/casing of the type key matches InputSource.TYPE_PROPERTY
  3. Round-trip the spec through the catalog API to see the canonical serialized form

Example fix

// before
"source":{"baseDir":"/data"}
// after
"source":{"type":"local","baseDir":"/data"}
Defensive patterns

Strategy: validation

Validate before calling

// Java
Object type = ((Map<?,?>) spec.get("source")).get("type");
if (type == null || type.toString().isEmpty())
  throw new IllegalArgumentException("input source map requires 'type' field");

Type guard

// Java
static boolean hasInputSourceType(Map<String,Object> sourceMap) {
  return sourceMap.get("type") instanceof String && !((String) sourceMap.get("type")).isEmpty();
}

Try / catch

try { resolved.resolve(registry); } catch (IAE e) { if (e.getMessage().contains("type") && e.getMessage().contains("required")) { /* add type to source map */ } else throw e; }

Prevention

When it happens

Trigger: Calling resolve() (usually via table validate) on a table whose inputSourceMap exists but lacks the "type" key inside the source map.

Common situations: Hand-built source maps missing type; key casing mistakes (Type vs type); serializers that drop the type field because it matched a default.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/2b387d5be3798928. Report an issue: GitHub.

Appendix: source

Thrown at server/src/main/java/org/apache/druid/catalog/model/table/ResolvedExternalTable.java:86

  public ResolvedTable resolvedTable()
  {
    return table;
  }

  /**
   * Look up the input source type and input format type to find the corresponding
   * definitions in the table registry. Throws an exception if the types are not
   * defined. The input source is required, the format is optional.
   * <p>
   * Note, for resolution to work, the name of each definition must be the same as
   * that used as the type key in the serialized JSON.
   */
  public ResolvedExternalTable resolve(TableDefnRegistry registry)
  {
    String inputSourceType = CatalogUtils.getString(inputSourceMap, InputSource.TYPE_PROPERTY);
    if (inputSourceType == null) {
      throw new IAE("Input source type %s is required", InputSource.TYPE_PROPERTY);
    }
    inputSourceDefn = registry.inputSourceDefnFor(inputSourceType);
    if (inputSourceDefn == null) {
      throw new IAE("Input source type %s is not registered", inputSourceType);
    }
    if (inputFormatMap != null) {
      String inputFormatType = CatalogUtils.getString(inputFormatMap, InputFormat.TYPE_PROPERTY);
      if (inputFormatType != null) {
        inputFormatDefn = registry.inputFormatDefnFor(inputFormatType);
        if (inputFormatDefn == null) {
          throw new IAE("Input format type %s is not registered", inputFormatType);
        }
      }
    }
    return this;
  }

  /**

View on GitHub (pinned to 9b90983fd2)