apache/druid · error · IllegalArgumentException

[ ] property must be provided

Error message

[%s] property must be provided

What it means

FormattedInputSourceDefn.convertTableToFormat reads the format 'type' property from the table's inputFormatMap; if it is absent the format cannot be resolved, so this IAE is thrown naming the missing property (InputFormat.TYPE_PROPERTY).

Solutions

  1. Add the "type" property to the inputFormatMap, e.g. {"type":"csv"}.
  2. Ensure format properties are nested under the format object, not alongside it.
  3. Recreate the spec via the UI so the format type is set.
  4. Validate the inputFormatMap contains InputFormat.TYPE_PROPERTY before calling convert.

Example fix

// before
"inputFormat": {"skipHeaderRows": 0}
// after
"inputFormat": {"type": "csv", "skipHeaderRows": 0}
Defensive patterns

Strategy: validation

Validate before calling

Map<String,Object> fmt = table.getInputFormatMap();
if (fmt == null || fmt.get("type") == null) throw new IllegalArgumentException("inputFormat.type is required");

Type guard

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

Try / catch

try { format = defn.convertTableToFormat(table); } catch (IAE e) { if (e.getMessage().contains("property must be provided")) { fixFormatMap(table); format = defn.convertTableToFormat(table); } }

Prevention

When it happens

Trigger: Converting a partial formatted table (convertPartialFormattedTable) whose inputFormatMap exists but lacks the 'type' key, or where CatalogUtils.getString returns null for it.

Common situations: Specs with format properties but no {"type": ...} tag; JSON written by hand that nests properties above the type field; partial updates that replace the format map with properties only.

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

Appendix: source

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

          throw new ISE(
              "Format [%s], property [%s] of class [%s] conflicts with another format property of class [%s]",
              format.typeValue(),
              prop.name(),
              prop.type().sqlName(),
              existing.type().sqlName()
          );
        }
      }
    }
    return CatalogUtils.concatLists(properties, toAdd);
  }

  @Override
  protected InputFormat convertTableToFormat(ResolvedExternalTable table)
  {
    final String formatTag = CatalogUtils.getString(table.inputFormatMap, InputFormat.TYPE_PROPERTY);
    if (formatTag == null) {
      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);

View on GitHub (pinned to 9b90983fd2)