apache/druid · error · IAE
An inline input source must provide a format.
Error message
An inline input source must provide a format.
What it means
InlineInputSourceDefn.validate requires that an inline external table specifies an input format. Inline data is raw text parsed according to a format, so without one Druid cannot interpret the rows. Thrown as IllegalArgumentException during table validation when inputFormatMap is null.
Source
Thrown at server/src/main/java/org/apache/druid/catalog/model/table/InlineInputSourceDefn.java:80
protected List<ParameterDefn> adHocTableFnParameters()
{
return Collections.singletonList(
new Parameter(DATA_PROPERTY, ParameterType.VARCHAR_ARRAY, false)
);
}
@Override
public TableFunction partialTableFn(ResolvedExternalTable table)
{
return new PartialTableFunction(table, Collections.emptyList());
}
@Override
public void validate(ResolvedExternalTable table)
{
// For inline, format is required to match the data
if (table.inputFormatMap == null) {
throw new IAE("An inline input source must provide a format.");
}
if (CollectionUtils.isNullOrEmpty(table.resolvedTable().spec().columns())) {
throw new IAE("An inline input source must provide one or more columns");
}
super.validate(table);
}
@Override
protected void convertArgsToSourceMap(Map<String, Object> jsonMap, Map<String, Object> args)
{
jsonMap.put(InputSource.TYPE_PROPERTY, InlineInputSource.TYPE_KEY);
List<String> data = CatalogUtils.getStringArray(args, DATA_PROPERTY);
// Would be nice, from a completeness perspective, for the inline data
// source to allow zero rows of data. However, such is not the case.
if (CollectionUtils.isNullOrEmpty(data)) {
throw new IAE(View on GitHub (pinned to 9b90983fd2)
Solutions
- Add an input format (e.g. {"type":"csv"}) to the inline table spec
- Verify the table JSON includes a non-empty format section before submitting
- Use validation tooling or the catalog API to check the spec before save
Example fix
// before
{"source":{"type":"inline","data":"a,b"}}
// after
{"source":{"type":"inline","data":"a,b"},"format":{"type":"csv"}} Defensive patterns
Strategy: validation
Validate before calling
if (spec.getSource().getType().equals("inline") && spec.getInputFormatMap() == null) {
throw new IllegalArgumentException("inline source requires an input format");
} Try / catch
try { defn.validate(table); } catch (IAE e) { if (e.getMessage().contains("must provide a format")) { /* add format to spec */ } else { throw e; } } Prevention
- Always include a format block (csv, json, etc.) in inline table specs
- Build specs via helpers that enforce format presence
- Validate spec JSON before saving to the catalog
When it happens
Trigger: Validating (validate) a ResolvedExternalTable of inline type whose resolved table spec has no input format map — e.g. table created without a format property or with an empty format section.
Common situations: Creating an inline table in the catalog and forgetting the format property; copying an inline source snippet without its format block; a UI/API client that omits format when columns are provided.
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
- An inline input source must provide one or more columns
- An inline table requires one or more rows of data in the '%s
- A local input source requires one property of %s or %s
- '%s' must be a string or an array of strings
- S3 requires one of %s, %s or %s
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/7e1b6459466d0fd3.
Report an issue: GitHub.