apache/druid · error · IllegalArgumentException

Invalid input source specification

Error message

Invalid input source specification

What it means

Thrown by BaseInputSourceDefn.convertSource when the input source JSON map cannot be converted into the corresponding Druid InputSource class via Jackson, after an optional audit step. The underlying Jackson (or audit) exception is attached as the cause and logged at debug level, so the real reason (unknown property, wrong type, malformed nested object) is in the cause chain.

Source

Thrown at server/src/main/java/org/apache/druid/catalog/model/table/BaseInputSourceDefn.java:248

    );
  }

  /**
   * Convert from a generic Java map to the target input source using the object
   * mapper provided. Translates Jackson errors into a generic unchecked error.
   */
  protected InputSource convertSource(
      final Map<String, Object> jsonMap,
      final ObjectMapper jsonMapper
  )
  {
    try {
      auditInputSource(jsonMap);
      return jsonMapper.convertValue(jsonMap, inputSourceClass());
    }
    catch (Exception e) {
      LOG.debug(e, "Invalid input source specification");
      throw new IAE(e, "Invalid input source specification");
    }
  }

  /**
   * Optional step to audit or adjust the input source properties prior to
   * conversion via Jackson. Changes are made directly in the {@code jsonMap}.
   */
  protected void auditInputSource(Map<String, Object> jsonMap)
  {
  }

  /**
   * Convert the format spec, if any, to an input format.
   */
  protected abstract InputFormat convertTableToFormat(ResolvedExternalTable table);

  /**
   *  Choose table or SQL-provided columns: table takes precedence.

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Inspect the wrapped cause exception (IAE.getCause() or debug logs) for the exact Jackson error and property name.
  2. Fix the property names and value types in the input source map to match the InputSource class.
  3. Validate the input source JSON with the format's ParameterDefn list before conversion.
  4. Confirm the input source 'type' matches a registered InputSourceDefn.

Example fix

// before
{"type":"inline","datas":"{\"a\":1}"}
// after
{"type":"inline","data":"{\"a\":1}"}
Defensive patterns

Strategy: try-catch

Validate before calling

// before calling convertSource
if (jsonMap.get("type") == null) throw new IllegalArgumentException("input source type required");
// ensure nested values are Maps, not Strings, e.g.
if (!(jsonMap.get("format") instanceof Map) && jsonMap.get("format") != null) throw new IllegalArgumentException("format must be an object");

Type guard

boolean isValidInputSourceMap(Map<String,Object> m) { return m != null && m.get("type") instanceof String; }

Try / catch

try { InputSource s = defn.convertSource(jsonMap); ... } catch (IAE e) { LOG.error("bad input source: %s", e.getCause() != null ? e.getCause().getMessage() : e.getMessage()); throw e; }

Prevention

When it happens

Trigger: Calling convertArgsToSource or convertTableToSource with a properties map whose fields do not match the InputSource class: misspelled property names, wrong value types (string where object expected), or an auditInputSource adjustment that produces an invalid map.

Common situations: Hand-written or externally generated table specs with a typo in an input source property; a format object passed as a string; a spec produced by an older Druid version using a property name that was renamed.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


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