apache/druid · error · IllegalArgumentException

Format type [ ] for property [ ] is not valid

Error message

Format type [%s] for property [%s] is not valid

What it means

After reading the format 'type' property, convertTableToFormat looks it up in the registry of InputFormatDefn instances; an unknown tag means no registered format definition matches, so this IAE is thrown with the invalid tag and the property name.

Solutions

  1. Correct the 'type' value to a registered format tag (e.g. csv, json, orc, parquet, protobuf).
  2. Install/enable the extension that registers the needed InputFormatDefn.
  3. List valid formats via the SQL table function metadata or docs.
  4. Check for case differences and use the exact tag the defn's typeValue() returns.

Example fix

// before
"inputFormat": {"type": "jsonl"}
// after
"inputFormat": {"type": "json"}
Defensive patterns

Strategy: validation

Validate before calling

Set<String> valid = Set.of("csv","tsv","json","jsonline","ndjson","orc","parquet","protobuf","avro","delimited");
String t = (String) fmt.get("type");
if (t == null || !valid.contains(t)) throw new IllegalArgumentException("unknown format type: " + t);

Try / catch

try { format = defn.convertTableToFormat(table); } catch (IAE e) { if (e.getMessage().contains("is not valid")) { String tag = normalizeFormatTag(fmt.get("type")); fmt.put("type", tag); format = defn.convertTableToFormat(table); } }

Prevention

When it happens

Trigger: Setting the inputFormatMap 'type' to a value not registered with this FormattedInputSourceDefn (e.g. a typo like 'jsonl' or a format from an extension that is not loaded on the coordinator).

Common situations: Typos in format type ('csvs', 'jsonl'); querying a table created on a cluster with a format extension that is missing on the current node; case mismatches in the type tag.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

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

              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);
    }
    final InputFormatDefn formatDefn = formats.get(formatTag);
    if (formatDefn == null) {
      throw new IAE(

View on GitHub (pinned to 9b90983fd2)