apache/druid · error · IAE

An external HTTP table with a URI must also provide the corr

Error message

An external HTTP table with a URI must also provide the corresponding format

What it means

Thrown by HttpInputSourceDefn.validate when an external HTTP table declares a URI but provides no input format. With a concrete URI the table must also know how to parse the bytes fetched from it, which requires a format (and format factory) on the table.

Source

Thrown at server/src/main/java/org/apache/druid/catalog/model/table/HttpInputSourceDefn.java:155

    final String uriTemplate = table.resolvedTable().stringProperty(URI_TEMPLATE_PROPERTY);
    final boolean hasTemplate = uriTemplate != null;
    final boolean hasFormat = table.inputFormatMap != null;
    final boolean hasColumns = !CollectionUtils.isNullOrEmpty(table.resolvedTable().spec().columns());

    if (!hasUri && !hasTemplate) {
      throw new IAE(
          "External HTTP tables must provide either a URI or a %s property",
          URI_TEMPLATE_PROPERTY
      );
    }
    if (hasUri && hasTemplate) {
      throw new IAE(
          "External HTTP tables must provide only one of a URI or a %s property",
          URI_TEMPLATE_PROPERTY
      );
    }
    if (hasUri && !hasFormat) {
      throw new IAE(
          "An external HTTP table with a URI must also provide the corresponding format"
      );
    }
    if (hasUri && !hasColumns) {
      throw new IAE(
          "An external HTTP table with a URI must also provide the corresponding columns"
      );
    }
    if (hasTemplate) {

      // Verify the template
      templateMatcher(uriTemplate);

      // Patch in a dummy URI so that validation of the rest of the fields
      // will pass.
      try {
        sourceMap.put(
            URIS_FIELD,

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Add the format property to the table, e.g. {"format": {"type": "json"}} or the catalog's format argument
  2. Use the catalog table builder API to set format together with the URI
  3. Re-run validation after adding the format to confirm no further gaps

Example fix

// before
{"type": "http", "uris": ["https://a.com/d.json"]} // no format
// after
{"type": "http", "uris": ["https://a.com/d.json"]} + format: {"type": "json"}
Defensive patterns

Strategy: validation

Validate before calling

if (uris != null && uris.size() > 0 && format == null) { throw new IAE("format required with URI"); }

Prevention

When it happens

Trigger: Validating a table whose HTTP input source includes 'uris' but whose resolved table has inputFormatMap == null.

Common situations: Hand-writing a table spec and adding the URI but forgetting the 'format' property; a builder that sets the source before the format is attached and validation runs early.

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/d60536419ae87153. Report an issue: GitHub.