apache/druid · error · IllegalArgumentException

Must provide a value for the [%s] parameter

Error message

Must provide a value for the [%s] parameter

What it means

Thrown by FormattedInputSourceDefn.convertArgsToFormat when converting catalog table arguments into an InputFormat: the 'format' parameter is absent from the argument map. The catalog requires an explicit format tag to select the registered InputFormatDefn that performs the conversion.

Source

Thrown at server/src/main/java/org/apache/druid/catalog/model/table/FormattedInputSourceDefn.java:147

      throw new IAE("[%s] property must be provided", InputFormat.TYPE_PROPERTY);
    }
    final InputFormatDefn formatDefn = formats.get(formatTag);
    if (formatDefn == null) {
      throw new IAE(
          "Format type [%s] for property [%s] is not valid",
          formatTag,
          InputFormat.TYPE_PROPERTY
      );
    }
    return formatDefn.convertFromTable(table);
  }

  @Override
  protected InputFormat convertArgsToFormat(Map<String, Object> args, List<ColumnSpec> columns, ObjectMapper jsonMapper)
  {
    final String formatTag = CatalogUtils.getString(args, FORMAT_PARAMETER);
    if (formatTag == null) {
      throw new IAE("Must provide a value for the [%s] parameter", FORMAT_PARAMETER);
    }
    final InputFormatDefn formatDefn = formats.get(formatTag);
    if (formatDefn == null) {
      throw new IAE(
          "Format type [%s] for property [%s] is not valid",
          formatTag,
          FORMAT_PARAMETER
      );
    }
    return formatDefn.convertFromArgs(args, columns, jsonMapper);
  }

  /**
   * Converted a formatted external table given the table definition, function
   * args, columns and the merged generic JSON map representing the input source.
   *
   * @param table     the resolved external table from the catalog
   * @param args      values of arguments from an SQL table function. Here we consider

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Add the 'format' property to the table's argument map, e.g. {"format": "json"}
  2. Check for typos in the format property key (it must match FORMAT_PARAMETER exactly)
  3. Verify the table definition JSON passed to the catalog API includes the format field before calling convertPartialFormattedTable

Example fix

// before
Map<String, Object> args = Map.of("type", "http");
// after
Map<String, Object> args = Map.of("type", "http", "format", "json");
Defensive patterns

Strategy: validation

Validate before calling

if (args.get("format") == null) { throw new IllegalArgumentException("'format' is required"); }

Type guard

boolean hasFormat(Map<String,Object> args) { Object f = args.get("format"); return f instanceof String && !((String) f).isEmpty(); }

Try / catch

try { tableDefn.convertPartialFormattedTable(...); } catch (IAE e) { if (e.getMessage().contains("format")) { /* prompt user for format */ } else { throw e; } }

Prevention

When it happens

Trigger: Calling convertPartialFormattedTable (e.g. when resolving a partial external table definition) with an args map that lacks the FORMAT_PARAMETER ('format') entry, so CatalogUtils.getString returns null.

Common situations: Defining an external table in the Druid catalog without specifying the 'format' property (e.g. json, csv) alongside the input source; a typo like 'formt' or a properties map where the format key was accidentally removed during editing.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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