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 columns

What it means

Thrown by HttpInputSourceDefn.validate when an external HTTP table declares a URI but provides no column specification. The catalog requires explicit columns for URI-based HTTP tables so the format can map the fetched data to a known schema.

Source

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

    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,
            Collections.singletonList(new URI("https://bogus.com/file"))
        );
      }
      catch (Exception e) {
        throw new ISE(e, "URI parse failed");

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Define the columns list in the table spec, e.g. [{"name": "t", "type": "string"}, ...]
  2. Ensure each column has a valid name and Druid type
  3. Verify the serialized spec JSON actually contains the columns array

Example fix

// before
{"type": "http", "uris": [...], "format": {"type": "json"}} // no columns
// after
... + "columns": [{"name": "timestamp", "type": "long"}, {"name": "user", "type": "string"}]
Defensive patterns

Strategy: validation

Validate before calling

if (uris != null && (columns == null || columns.isEmpty())) { throw new IAE("columns required with URI"); }

Prevention

When it happens

Trigger: A table with 'uris' set and a format present, but table.resolvedTable().spec().columns() is empty when validate runs.

Common situations: Specifying format but skipping the column list in a hand-authored spec; programmatically building a table and forgetting addColumn calls; templates exempt from this check so the mistake appears only when switching to fixed URIs.

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